Class ContextMenuStripEx
ContextMenuStrip extended with title.
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class ContextMenuStripEx : ContextMenuStrip, IThemeProvider, IVisualStyle
Constructors
ContextMenuStripEx()
Declaration
public ContextMenuStripEx()
ContextMenuStripEx(String)
Declaration
public ContextMenuStripEx(string title)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | title |
Properties
CanApplyTheme
Gets or sets a value indicating whether a SkinManager theme style has been applied to the control.
Declaration
public bool CanApplyTheme { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is true. |
CanOverrideStyle
Gets or sets a value indicating whether control elements styles can be overridden by theme style settings.
Declaration
public bool CanOverrideStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Default value is false. |
Remarks
By default, the control's element styles will not be overridden by theme style settings if the style is set in sample level. If this property is enabled, element style will be overridden by theme style settings event if it is set in sample level. This property should be enabled or disabled before calling the ThemeName property of the control.
DisplayRectangle
Gets the bounds of the display rectangle.
Declaration
public override Rectangle DisplayRectangle { get; }
Property Value
| Type |
|---|
| System.Drawing.Rectangle |
EnableTouchMode
Gets or Sets the TouchMode
Declaration
public bool EnableTouchMode { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Font
Gets or sets the System.Drawing.Font value for the control.
Declaration
public override Font Font { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Font |
IsVisualStyleEnabled
Gets a value indicating whether the visual style based theme is applied to the control. This also indicates whether the theme files are referred from external assemblies or not.
Declaration
public bool IsVisualStyleEnabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Return true, if the visual style based theme is applied to control. Otherwise returns false. |
MetroColor
Gets or Set the Metrocolor
Declaration
public Color MetroColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
Style
Gets or sets the ContextMenuStripEx.ContextMenuStyle value used to customize the appearance of the ContextMenuStripEx control.
Declaration
public ContextMenuStripEx.ContextMenuStyle Style { get; set; }
Property Value
| Type |
|---|
| ContextMenuStripEx.ContextMenuStyle |
ThemeName
Gets or sets the theme name of the ContextMenuStripEx control.
Declaration
public string ThemeName { get; set; }
Property Value
| Type |
|---|
| System.String |
ThemeStyle
Gets or sets the ContextMenuStripExVisualStyle value used to customize the appearance of the ContextMenuStripEx.
Declaration
public ContextMenuStripExVisualStyle ThemeStyle { get; set; }
Property Value
| Type |
|---|
| ContextMenuStripExVisualStyle |
Methods
ApplyScaleToControl(Single)
Applies scale factor
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | scaleFactor |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
GetActiveThemeName()
Gets the active theme name of the ContextMenuStripEx control.
Declaration
public string GetActiveThemeName()
Returns
| Type | Description |
|---|---|
| System.String | Returns the active theme name. |
GetPreferredSize(Size)
Extends height for title.
Declaration
public override Size GetPreferredSize(Size proposedSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Size | proposedSize |
Returns
| Type |
|---|
| System.Drawing.Size |
OnFontChanged(EventArgs)
Resets title height.
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseDown(MouseEventArgs)
Disables right mouse button
Declaration
protected override void OnMouseDown(MouseEventArgs mea)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | mea |
OnMouseUp(MouseEventArgs)
Disables right mouse button
Declaration
protected override void OnMouseUp(MouseEventArgs mea)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | mea |
OnPaint(PaintEventArgs)
Override the method to draw the customized ContextMenuStrip.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.PaintEventArgs | e | A System.Windows.Forms.PaintEventArgs that contains the event data. |
OnTextChanged(EventArgs)
Resets title height.
Declaration
protected override void OnTextChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
Events
ThemeNameChanged
Occurs when theme name of the ContextMenuStripEx has changed.
Declaration
public event ThemeChangedEventHandler ThemeNameChanged
Event Type
| Type |
|---|
| ThemeChangedEventHandler |
Explicit Interface Implementations
IVisualStyle.VisualTheme
Gets or sets the VisualTheme of the ContextMenuStripEx control.
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
| Type |
|---|
| System.String |
IThemeProvider.BaseThemeName
Gets or sets the BaseTheme name of the theme
Declaration
string IThemeProvider.BaseThemeName { get; set; }
Returns
| Type |
|---|
| System.String |
IThemeProvider.ControlName
Gets the name of the control.
Declaration
string IThemeProvider.ControlName { get; }
Returns
| Type |
|---|
| System.String |