Inheritance
System.Object
MdiSysMenuProvider
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Syncfusion.Tools.Windows.dll
public class MdiSysMenuProvider : DisposableWithDisposedProp, IDisposable
Constructors
Declaration
public MdiSysMenuProvider()
Fields
Declaration
protected const string ICO_CLOSE = "Syncfusion.Windows.Forms.Tools.FrameworkComponents.XPMenus.bmps.closemc.ico"
Field Value
Declaration
protected const string ICO_MINIMIZE = "Syncfusion.Windows.Forms.Tools.FrameworkComponents.XPMenus.bmps.minimizemc.ico"
Field Value
Declaration
protected const string ICO_RESTORE = "Syncfusion.Windows.Forms.Tools.FrameworkComponents.XPMenus.bmps.restoremc.ico"
Field Value
Hash that stores to each window handle its menu handle.
key - handle to MdiChild window.
value - handle to MdiChild menu.
Declaration
protected Hashtable m_hashMenus
Field Value
Type |
System.Collections.Hashtable |
Declaration
protected IntPtr m_mnuActiveChild
Field Value
Declaration
protected MdiClient m_wndMdiClient
Field Value
Type |
System.Windows.Forms.MdiClient |
UM_REMOVE_MAIN_MENU
Declaration
protected const int UM_REMOVE_MAIN_MENU = 32771
Field Value
UM_RESTORE_MAIN_MENU
Declaration
protected const int UM_RESTORE_MAIN_MENU = 32772
Field Value
Properties
Declaration
public static int ButtonHeight { get; }
Property Value
Declaration
public Control Canvas { get; set; }
Property Value
Type |
System.Windows.Forms.Control |
Declaration
protected bool CloseButtonEnabled { get; }
Property Value
Declaration
protected bool CloseButtonHidden { get; }
Property Value
Declaration
public Rectangle ControlBoxRect { get; set; }
Property Value
Type |
System.Drawing.Rectangle |
Declaration
protected bool IsCanvasRTL { get; }
Property Value
Declaration
protected bool IsChildMaximized { get; }
Property Value
Declaration
public bool IsVertical { get; set; }
Property Value
MainForm
Declaration
public Form MainForm { get; set; }
Property Value
Type |
System.Windows.Forms.Form |
Declaration
protected bool MinimizeButtonDisabled { get; }
Property Value
Declaration
protected bool MinimizeButtonHidden { get; }
Property Value
Declaration
public bool NeedMenuButtons { get; }
Property Value
Declaration
public bool NeedUpdateHostedForm { get; set; }
Property Value
Declaration
protected Rectangle rcCloseButton { get; }
Property Value
Type |
System.Drawing.Rectangle |
Declaration
protected Rectangle rcMinButton { get; }
Property Value
Type |
System.Drawing.Rectangle |
Declaration
protected Rectangle rcRestoreButton { get; }
Property Value
Type |
System.Drawing.Rectangle |
Declaration
protected bool RestoreButtonDisabled { get; }
Property Value
Declaration
protected bool RestoreButtonHidden { get; }
Property Value
Indicates whether the control box should be drawn with the minimize, maximize and close buttons.
Declaration
public bool ShowControlBox { get; set; }
Property Value
Type |
Description |
System.Boolean |
True to show the control box; false otherwise. Default is true.
|
Declaration
public bool ShowIcon { get; }
Property Value
Gets or sets a value indicating whether to show the System Button ToolTips on the Bar when MDI Child Form is maximized.
Declaration
public bool ShowToolTipOnMDIChildMax { get; set; }
Property Value
Type |
Description |
System.Boolean |
true Display System Button ToolTip; otherwise, do not display System Button ToolTipfalse.
|
Gets / sets the Visual Style.
Declaration
public VisualStyle Style { get; set; }
Property Value
Declaration
public Rectangle SystemIconRect { get; set; }
Property Value
Type |
System.Drawing.Rectangle |
Declaration
public PopupMenu SystemMenu { get; }
Property Value
Declaration
public Form WndActiveChild { get; set; }
Property Value
Type |
System.Windows.Forms.Form |
Methods
Declaration
public void ActivateProvider(Control canvas)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Control |
canvas |
|
Declaration
protected void ApplyMenuCaption(IntPtr hsysmenu, long commandID, BarItem itemDest)
Parameters
Type |
Name |
Description |
System.IntPtr |
hsysmenu |
|
System.Int64 |
commandID |
|
BarItem |
itemDest |
|
Attaches Hook which allows easy catch of: MDI child maximization,
MDI Child restore, MDI Child switching and etc.
Declaration
protected void AttachHook()
Locks repainting of MainForm. After Locking window stops redrawing
until UnLock action done. You can safely call BeginUpdate several
times (but always must be corresponding code which will call EndUpdate),
because we have internal counter which accumulates calls. Several
calls simply increase counter for UnLock method EndUpdate.
Declaration
protected void BeginUpdate()
Declaration
protected void ControlCanvas_Resize(object sender, EventArgs arg)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
System.EventArgs |
arg |
|
Declaration
public void CorrectLayout()
Declaration
public void DeactivateProvider()
Declaration
protected void DestroyMDIActiveChild()
Detaches hook on class destroy.
Declaration
protected void DetachHook()
Declaration
protected override void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
Overrides
Declaration
protected void DrawButtonHilight(MdiSysMenuProvider.SysButtons button, bool btndown)
Parameters
Declaration
protected void DrawCloseButton(Graphics gph, bool btndown)
Parameters
Type |
Name |
Description |
System.Drawing.Graphics |
gph |
|
System.Boolean |
btndown |
|
Declaration
protected void DrawMinimizeButton(Graphics gph, bool btndown)
Parameters
Type |
Name |
Description |
System.Drawing.Graphics |
gph |
|
System.Boolean |
btndown |
|
Declaration
protected void DrawRestoreButton(Graphics gph, bool btndown)
Parameters
Type |
Name |
Description |
System.Drawing.Graphics |
gph |
|
System.Boolean |
btndown |
|
UnLocks repainting of MainForm. After UnLocking form Invalidation
will work. We have internal counter that is why each call of BeginUpdate
must have corresponding EndUpdate method call, otherwise window redrawing
will be in locked state till end of time.
Declaration
protected void EndUpdate()
Declaration
protected void EraseButtonHilight(MdiSysMenuProvider.SysButtons button)
Parameters
Finds by Handle the corresponding MDI Child.
Declaration
protected Form FindChildByHandle(IntPtr child)
Parameters
Type |
Name |
Description |
System.IntPtr |
child |
Handle to check.
|
Returns
Type |
Description |
System.Windows.Forms.Form |
Null - if nothing found; otherwise MDI Child form
|
Invalidates only part of form - it's Caption NonClient area.
Declaration
protected void ForceRedrawCaptionOnly()
Force window invalidation. Window will redraw itself even if
repainting is locked.
Declaration
protected void ForceRedrawCompletly()
Extracts icon from resources.
Declaration
protected static Icon GetIcon(string resourceName)
Parameters
Type |
Name |
Description |
System.String |
resourceName |
resource name
|
Returns
Type |
Description |
System.Drawing.Icon |
Instance of recovered icon
|
Returns the handle of active MDI Child.
Declaration
protected bool GetMdiActiveChild(out IntPtr handle)
Parameters
Type |
Name |
Description |
System.IntPtr |
handle |
Handle of active MDI Childs.
|
Returns
Type |
Description |
System.Boolean |
True if child is maximized; false otherwise.
|
Declaration
public void HandleMouseDoubleClick(Point ptclient)
Parameters
Type |
Name |
Description |
System.Drawing.Point |
ptclient |
|
Declaration
public void HandleMouseDown(Point ptclient)
Parameters
Type |
Name |
Description |
System.Drawing.Point |
ptclient |
|
Declaration
public void HandleMouseLeave()
Declaration
public void HandleMouseMove(Point ptclient)
Parameters
Type |
Name |
Description |
System.Drawing.Point |
ptclient |
|
Declaration
public void HandleMouseUp(Point ptclient)
Parameters
Type |
Name |
Description |
System.Drawing.Point |
ptclient |
|
Declaration
public void HandlePaint(Graphics gph)
Parameters
Type |
Name |
Description |
System.Drawing.Graphics |
gph |
|
Declaration
protected void InitializeProvider(Form mainfrm)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Form |
mainfrm |
|
Declaration
protected virtual void InitSystemMenu()
Declaration
protected void InvalidateHostedForm()
Declaration
protected void MDIChildActivate(IntPtr wndHandle)
Parameters
Type |
Name |
Description |
System.IntPtr |
wndHandle |
|
Declaration
protected void MinimizeMDIActiveChild()
Hook function that catches MDI child's actions.
Declaration
protected IntPtr MsgHook(int nCode, IntPtr wParam, IntPtr lParam)
Parameters
Type |
Name |
Description |
System.Int32 |
nCode |
|
System.IntPtr |
wParam |
|
System.IntPtr |
lParam |
|
Returns
Declaration
protected void NextWindowMDIActiveChild(bool bprevious)
Parameters
Type |
Name |
Description |
System.Boolean |
bprevious |
|
Declaration
protected void OnNeedMenuButtonsChanged(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected virtual void OnPerformingTransform(TransformEventArgs e)
Parameters
Declaration
protected void PopupSystemMenu(Point pt)
Parameters
Type |
Name |
Description |
System.Drawing.Point |
pt |
|
Resets variables to state in which toolbar will be drawn with only barItems and
without system menu and caption buttons.
Declaration
protected void RemoveToolbarButtons()
Declaration
protected void RestoreMDIActiveChild()
Declaration
protected void SetSysMenuCaptions()
Updates toolbar and set variables which indicate toolbar to show
control box buttons and sys menu icon.
Declaration
protected void SetToolbarButtons(Form activeChild)
Parameters
Type |
Name |
Description |
System.Windows.Forms.Form |
activeChild |
Active child reference.
|
Declaration
protected virtual void SystemMenuClicked(object sender, EventArgs e)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
System.EventArgs |
e |
|
Declaration
protected void UnInitializeProvider()
Events
Throws an event when the NeedMenuButtons property changes.
Declaration
public event EventHandler NeedMenuButtonsChanged
Event Type
Declaration
public event TransformEventHandler PerformingTransform
Event Type
Implements
System.IDisposable