Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public MyCustomForm()
- {
- Icon = GetExecutableIcon();
- }
- public Icon GetExecutableIcon()
- {
- IntPtr large;
- IntPtr small;
- ExtractIconEx(Application.ExecutablePath, 0, out large, out small, 1);
- return Icon.FromHandle(small);
- }
- [DllImport("Shell32")]
- public static extern int ExtractIconEx(
- string sFile,
- int iIndex,
- out IntPtr piLargeVersion,
- out IntPtr piSmallVersion,
- int amountIcons);
- public new Form Owner {
- set {
- this.Icon = (value == null ? null : value.Icon);
- base.Owner = value;
- }
- get {
- return base.Owner;
- }
- }
- form.icon = MainFrom.Icon
- Icon = MainFrom.Icon
Add Comment
Please, Sign In to add comment