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);
}
}
↧
Answer by Ray for c# - If condition: mouse key clicked and bAlpha
↧