Last active
January 5, 2022 07:41
-
-
Save yamamaya/a130ec64f2295e6fdb6c1ea792702ede to your computer and use it in GitHub Desktop.
Transparent cover to prevent mouse operation in Windows Forms application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
namespace OaktreeLab.Utils { | |
public class TransparentCover : Panel { | |
private const int WS_EX_TRANSPARENT = 0x00000020; | |
protected override CreateParams CreateParams { | |
get { | |
CreateParams param = base.CreateParams; | |
param.ExStyle |= WS_EX_TRANSPARENT; | |
return param; | |
} | |
} | |
protected override void OnPaintBackground( PaintEventArgs e ) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment