+2007-01-15 Jonathan Pobst <jpobst@novell.com>
+
+ * Form.cs: Implement Form.ShowIcon.
+
+ * XplatUIWin32.cs: Allow the SetIcon win32 call to set the icon to
+ null, which when combined with the DlgModalFrame window style removes
+ the icon from the title bar.
+
2007-01-15 Jonathan Pobst <jpobst@novell.com>
* Control.cs: Call OnMouseClick after OnClick. (2.0)
#if NET_2_0
private MenuStrip main_menu_strip;
+ private bool show_icon;
#endif
#endregion // Local Variables
owned_forms = new Form.ControlCollection(this);
transparency_key = Color.Empty;
+#if NET_2_0
+ show_icon = true;
+#endif
+
// FIXME: this should disappear just as soon as the handle creation is done in the right place (here is too soon()
UpdateBounds();
}
}
+#if NET_2_0
+ [DefaultValue (true)]
+ public bool ShowIcon {
+ get { return this.show_icon; }
+ set {
+ if (this.show_icon != value ) {
+ this.show_icon = value;
+ UpdateStyles ();
+
+ XplatUI.SetIcon (this.Handle, value == true ? this.Icon : null);
+
+ Message msg = new Message ();
+ XplatUI.InvalidateNC (this.Handle);
+ }
+ }
+ }
+#endif
+
[DefaultValue(true)]
[MWFCategory("Window Style")]
public bool ShowInTaskbar {
cp.Style |= (int)WindowStyles.WS_SYSMENU;
}
+#if NET_2_0
+ if (!this.show_icon) {
+ cp.ExStyle |= (int)WindowExStyles.WS_EX_DLGMODALFRAME;
+ }
+#endif
+
if (HelpButton && !MaximizeBox && !MinimizeBox) {
cp.ExStyle |= (int)WindowExStyles.WS_EX_CONTEXTHELP;
}
}
internal override void SetIcon(IntPtr hwnd, Icon icon) {
- Win32SendMessage(hwnd, Msg.WM_SETICON, (IntPtr)1, icon.Handle); // 1 = large icon (0 would be small)
+ Win32SendMessage(hwnd, Msg.WM_SETICON, (IntPtr)1, icon == null ? IntPtr.Zero : icon.Handle); // 1 = large icon (0 would be small)
}
internal override void ClipboardClose(IntPtr handle) {