WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MdiSysMenuProvider

    Show / Hide Table of Contents

    Class MdiSysMenuProvider

    Inheritance
    System.Object
    NonFinalizeDisposableWithDisposedProp
    DisposableWithDisposedProp
    MdiSysMenuProvider
    Implements
    System.IDisposable
    Inherited Members
    NonFinalizeDisposableWithDisposedProp.m_bDisposed
    NonFinalizeDisposableWithDisposedProp.Dispose()
    NonFinalizeDisposableWithDisposedProp.IsDisposed
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Tools.XPMenus
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class MdiSysMenuProvider : DisposableWithDisposedProp, IDisposable

    Constructors

    MdiSysMenuProvider()

    Default constructor.

    Declaration
    public MdiSysMenuProvider()

    Fields

    ICO_CLOSE

    Declaration
    protected const string ICO_CLOSE = "Syncfusion.Windows.Forms.Tools.FrameworkComponents.XPMenus.bmps.closemc.ico"
    Field Value
    Type Description
    System.String

    ICO_MINIMIZE

    Declaration
    protected const string ICO_MINIMIZE = "Syncfusion.Windows.Forms.Tools.FrameworkComponents.XPMenus.bmps.minimizemc.ico"
    Field Value
    Type Description
    System.String

    ICO_RESTORE

    Declaration
    protected const string ICO_RESTORE = "Syncfusion.Windows.Forms.Tools.FrameworkComponents.XPMenus.bmps.restoremc.ico"
    Field Value
    Type Description
    System.String

    m_hashMenus

    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 Description
    System.Collections.Hashtable

    m_mnuActiveChild

    Declaration
    protected IntPtr m_mnuActiveChild
    Field Value
    Type Description
    System.IntPtr

    m_wndMdiClient

    Declaration
    protected MdiClient m_wndMdiClient
    Field Value
    Type Description
    System.Windows.Forms.MdiClient

    UM_REMOVE_MAIN_MENU

    WM_APP + 3

    Declaration
    protected const int UM_REMOVE_MAIN_MENU = 32771
    Field Value
    Type Description
    System.Int32

    UM_RESTORE_MAIN_MENU

    WM_APP + 4

    Declaration
    protected const int UM_RESTORE_MAIN_MENU = 32772
    Field Value
    Type Description
    System.Int32

    Properties

    ButtonHeight

    Declaration
    public static int ButtonHeight { get; }
    Property Value
    Type Description
    System.Int32

    Canvas

    Declaration
    public Control Canvas { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.Control

    CloseButtonEnabled

    Declaration
    protected bool CloseButtonEnabled { get; }
    Property Value
    Type Description
    System.Boolean

    CloseButtonHidden

    Declaration
    protected bool CloseButtonHidden { get; }
    Property Value
    Type Description
    System.Boolean

    ControlBoxRect

    Declaration
    public Rectangle ControlBoxRect { get; set; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    IsCanvasRTL

    Declaration
    protected bool IsCanvasRTL { get; }
    Property Value
    Type Description
    System.Boolean

    IsChildMaximized

    Declaration
    protected bool IsChildMaximized { get; }
    Property Value
    Type Description
    System.Boolean

    IsVertical

    Declaration
    public bool IsVertical { get; set; }
    Property Value
    Type Description
    System.Boolean

    MainForm

    Declaration
    public Form MainForm { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.Form

    MinimizeButtonDisabled

    Declaration
    protected bool MinimizeButtonDisabled { get; }
    Property Value
    Type Description
    System.Boolean

    MinimizeButtonHidden

    Declaration
    protected bool MinimizeButtonHidden { get; }
    Property Value
    Type Description
    System.Boolean

    NeedMenuButtons

    Declaration
    public bool NeedMenuButtons { get; }
    Property Value
    Type Description
    System.Boolean

    NeedUpdateHostedForm

    Declaration
    public bool NeedUpdateHostedForm { get; set; }
    Property Value
    Type Description
    System.Boolean

    rcCloseButton

    Declaration
    protected Rectangle rcCloseButton { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    rcMinButton

    Declaration
    protected Rectangle rcMinButton { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    rcRestoreButton

    Declaration
    protected Rectangle rcRestoreButton { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    RestoreButtonDisabled

    Declaration
    protected bool RestoreButtonDisabled { get; }
    Property Value
    Type Description
    System.Boolean

    RestoreButtonHidden

    Declaration
    protected bool RestoreButtonHidden { get; }
    Property Value
    Type Description
    System.Boolean

    ShowControlBox

    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.

    Remarks

    If a child form's ControlBox property is set to false, then the control box buttons will be drawn inactive rather than hidden, in accordance with the .NET menus behavior.

    If you want to alter this behavior and instead want the control box to be hidden, set this property to false.

    ShowIcon

    Declaration
    public bool ShowIcon { get; }
    Property Value
    Type Description
    System.Boolean

    ShowToolTipOnMDIChildMax

    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.

    Style

    Gets / sets the Visual Style.

    Declaration
    public VisualStyle Style { get; set; }
    Property Value
    Type Description
    VisualStyle

    SystemIconRect

    Declaration
    public Rectangle SystemIconRect { get; set; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    SystemMenu

    Declaration
    public PopupMenu SystemMenu { get; }
    Property Value
    Type Description
    PopupMenu

    WndActiveChild

    Declaration
    public Form WndActiveChild { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.Form

    Methods

    ActivateProvider(Control)

    Declaration
    public void ActivateProvider(Control canvas)
    Parameters
    Type Name Description
    System.Windows.Forms.Control canvas

    ApplyMenuCaption(IntPtr, Int64, BarItem)

    Declaration
    protected void ApplyMenuCaption(IntPtr hsysmenu, long commandID, BarItem itemDest)
    Parameters
    Type Name Description
    System.IntPtr hsysmenu
    System.Int64 commandID
    BarItem itemDest

    AttachHook()

    Attaches Hook which allows easy catch of: MDI child maximization, MDI Child restore, MDI Child switching and etc.

    Declaration
    protected void AttachHook()

    BeginUpdate()

    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()

    ControlCanvas_Resize(Object, EventArgs)

    Declaration
    protected void ControlCanvas_Resize(object sender, EventArgs arg)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs arg

    CorrectLayout()

    Declaration
    public void CorrectLayout()

    DeactivateProvider()

    Declaration
    public void DeactivateProvider()

    DestroyMDIActiveChild()

    Declaration
    protected void DestroyMDIActiveChild()

    DetachHook()

    Detaches hook on class destroy.

    Declaration
    protected void DetachHook()

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    NonFinalizeDisposableWithDisposedProp.Dispose(Boolean)

    DrawButtonHilight(MdiSysMenuProvider.SysButtons, Boolean)

    Declaration
    protected void DrawButtonHilight(MdiSysMenuProvider.SysButtons button, bool btndown)
    Parameters
    Type Name Description
    MdiSysMenuProvider.SysButtons button
    System.Boolean btndown

    DrawCloseButton(Graphics, Boolean)

    Declaration
    protected void DrawCloseButton(Graphics gph, bool btndown)
    Parameters
    Type Name Description
    System.Drawing.Graphics gph
    System.Boolean btndown

    DrawMinimizeButton(Graphics, Boolean)

    Declaration
    protected void DrawMinimizeButton(Graphics gph, bool btndown)
    Parameters
    Type Name Description
    System.Drawing.Graphics gph
    System.Boolean btndown

    DrawRestoreButton(Graphics, Boolean)

    Declaration
    protected void DrawRestoreButton(Graphics gph, bool btndown)
    Parameters
    Type Name Description
    System.Drawing.Graphics gph
    System.Boolean btndown

    EndUpdate()

    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()

    EraseButtonHilight(MdiSysMenuProvider.SysButtons)

    Declaration
    protected void EraseButtonHilight(MdiSysMenuProvider.SysButtons button)
    Parameters
    Type Name Description
    MdiSysMenuProvider.SysButtons button

    FindChildByHandle(IntPtr)

    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

    ForceRedrawCaptionOnly()

    Invalidates only part of form - it's Caption NonClient area.

    Declaration
    protected void ForceRedrawCaptionOnly()

    ForceRedrawCompletly()

    Force window invalidation. Window will redraw itself even if repainting is locked.

    Declaration
    protected void ForceRedrawCompletly()

    GetIcon(String)

    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

    GetMdiActiveChild(out IntPtr)

    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.

    HandleMouseDoubleClick(Point)

    Declaration
    public void HandleMouseDoubleClick(Point ptclient)
    Parameters
    Type Name Description
    System.Drawing.Point ptclient

    HandleMouseDown(Point)

    Declaration
    public void HandleMouseDown(Point ptclient)
    Parameters
    Type Name Description
    System.Drawing.Point ptclient

    HandleMouseLeave()

    Declaration
    public void HandleMouseLeave()

    HandleMouseMove(Point)

    Declaration
    public void HandleMouseMove(Point ptclient)
    Parameters
    Type Name Description
    System.Drawing.Point ptclient

    HandleMouseUp(Point)

    Declaration
    public void HandleMouseUp(Point ptclient)
    Parameters
    Type Name Description
    System.Drawing.Point ptclient

    HandlePaint(Graphics)

    Declaration
    public void HandlePaint(Graphics gph)
    Parameters
    Type Name Description
    System.Drawing.Graphics gph

    InitializeProvider(Form)

    Declaration
    protected void InitializeProvider(Form mainfrm)
    Parameters
    Type Name Description
    System.Windows.Forms.Form mainfrm

    InitSystemMenu()

    Declaration
    protected virtual void InitSystemMenu()

    InvalidateHostedForm()

    Declaration
    protected void InvalidateHostedForm()

    MDIChildActivate(IntPtr)

    Declaration
    protected void MDIChildActivate(IntPtr wndHandle)
    Parameters
    Type Name Description
    System.IntPtr wndHandle

    MinimizeMDIActiveChild()

    Declaration
    protected void MinimizeMDIActiveChild()

    MsgHook(Int32, IntPtr, IntPtr)

    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
    Type Description
    System.IntPtr

    NextWindowMDIActiveChild(Boolean)

    Declaration
    protected void NextWindowMDIActiveChild(bool bprevious)
    Parameters
    Type Name Description
    System.Boolean bprevious

    OnNeedMenuButtonsChanged(EventArgs)

    Declaration
    protected void OnNeedMenuButtonsChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnPerformingTransform(TransformEventArgs)

    Declaration
    protected virtual void OnPerformingTransform(TransformEventArgs e)
    Parameters
    Type Name Description
    TransformEventArgs e

    PopupSystemMenu(Point)

    Declaration
    protected void PopupSystemMenu(Point pt)
    Parameters
    Type Name Description
    System.Drawing.Point pt

    RemoveToolbarButtons()

    Resets variables to state in which toolbar will be drawn with only barItems and without system menu and caption buttons.

    Declaration
    protected void RemoveToolbarButtons()

    RestoreMDIActiveChild()

    Declaration
    protected void RestoreMDIActiveChild()

    SetSysMenuCaptions()

    Declaration
    protected void SetSysMenuCaptions()

    SetToolbarButtons(Form)

    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.

    SystemMenuClicked(Object, EventArgs)

    Declaration
    protected virtual void SystemMenuClicked(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    UnInitializeProvider()

    Declaration
    protected void UnInitializeProvider()

    Events

    NeedMenuButtonsChanged

    Throws an event when the NeedMenuButtons property changes.

    Declaration
    public event EventHandler NeedMenuButtonsChanged
    Event Type
    Type Description
    System.EventHandler

    PerformingTransform

    Declaration
    public event TransformEventHandler PerformingTransform
    Event Type
    Type Description
    TransformEventHandler

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved