Skip to content

Instantly share code, notes, and snippets.

@yamamaya
Last active January 5, 2022 07:41
Show Gist options
  • Save yamamaya/a130ec64f2295e6fdb6c1ea792702ede to your computer and use it in GitHub Desktop.
Save yamamaya/a130ec64f2295e6fdb6c1ea792702ede to your computer and use it in GitHub Desktop.
Transparent cover to prevent mouse operation in Windows Forms application.
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