Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Ray for c# - If condition: mouse key clicked and bAlpha

bool _transparent;

private void Form1_MouseDown(object sender, MouseEventArgs e)
{
    SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_LAYERED);
    if (e.Button == MouseButtons.Right)
    {
        _transparent = !_transparent;
        byte alpha = (byte)(_transparent ? 10 : 255);
        SetLayeredWindowAttributes(Handle, 0, alpha, LWA_ALPHA);
    }
}

Viewing all articles
Browse latest Browse all 3

Trending Articles