Class DropDownButton
A System.Windows.Forms.Button with an additional drop-down menu.
public class DropDownButton : Button
- Inheritance
-
objectMarshalByRefObjectComponentControlButtonBaseButtonDropDownButton
- Extension Methods
Constructors
DropDownButton()
public DropDownButton()
Properties
ContextMenuStrip
Gets or sets the System.Windows.Forms.ContextMenuStrip associated with this control.
[Browsable(false)]
public override ContextMenuStrip? ContextMenuStrip { get; set; }
Property Value
- ContextMenuStrip
The System.Windows.Forms.ContextMenuStrip for this control, or null if there is no System.Windows.Forms.ContextMenuStrip. The default is null.
DropDownMenuStrip
public ContextMenuStrip? DropDownMenuStrip { get; set; }
Property Value
- ContextMenuStrip
ShowSplit
Splits the button into a conventional "button" part and a "drop down" part rather than treating the entire button as a "drop down" button.
public bool ShowSplit { get; set; }
Property Value
- bool
Methods
GetPreferredSize(Size)
Retrieves the size of a rectangular area into which a control can be fitted.
public override Size GetPreferredSize(Size proposedSize)
Parameters
proposedSize
SizeThe custom-sized area for a control.
Returns
- Size
An ordered pair of type System.Drawing.Size representing the width and height of a rectangle.
IsInputKey(Keys)
Determines whether the specified key is a regular input key or a special key that requires preprocessing.
protected override bool IsInputKey(Keys keyData)
Parameters
keyData
KeysOne of the System.Windows.Forms.Keys values.
Returns
- bool
true if the specified key is a regular input key; otherwise, false.
OnEnabledChanged(EventArgs)
Raises the System.Windows.Forms.Control.EnabledChanged event.
protected override void OnEnabledChanged(EventArgs e)
Parameters
e
EventArgsAn System.EventArgs that contains the event data.
OnGotFocus(EventArgs)
Raises the System.Windows.Forms.Control.GotFocus event.
protected override void OnGotFocus(EventArgs e)
Parameters
e
EventArgsAn System.EventArgs that contains the event data.
OnKeyDown(KeyEventArgs)
Raises the System.Windows.Forms.ButtonBase.OnKeyUp(System.Windows.Forms.KeyEventArgs) event.
protected override void OnKeyDown(KeyEventArgs kevent)
Parameters
kevent
KeyEventArgsA System.Windows.Forms.KeyEventArgs that contains the event data.
OnKeyUp(KeyEventArgs)
Raises the System.Windows.Forms.ButtonBase.OnKeyUp(System.Windows.Forms.KeyEventArgs) event.
protected override void OnKeyUp(KeyEventArgs kevent)
Parameters
kevent
KeyEventArgsA System.Windows.Forms.KeyEventArgs that contains the event data.
OnLostFocus(EventArgs)
Raises the System.Windows.Forms.ButtonBase.OnLostFocus(System.EventArgs) event.
protected override void OnLostFocus(EventArgs e)
Parameters
e
EventArgsAn System.EventArgs that contains the event data.
OnMouseDown(MouseEventArgs)
Raises the System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs) event.
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
MouseEventArgs
OnMouseEnter(EventArgs)
Raises the System.Windows.Forms.Control.OnMouseEnter(System.EventArgs) event.
protected override void OnMouseEnter(EventArgs e)
Parameters
e
EventArgsAn System.EventArgs that contains the event data.
OnMouseLeave(EventArgs)
Raises the System.Windows.Forms.Control.OnMouseLeave(System.EventArgs) event.
protected override void OnMouseLeave(EventArgs e)
Parameters
e
EventArgs
OnMouseUp(MouseEventArgs)
Raises the System.Windows.Forms.ButtonBase.OnMouseUp(System.Windows.Forms.MouseEventArgs) event.
protected override void OnMouseUp(MouseEventArgs mevent)
Parameters
mevent
MouseEventArgsA System.Windows.Forms.MouseEventArgs that contains the event data.
OnPaint(PaintEventArgs)
Raises the System.Windows.Forms.ButtonBase.OnPaint(System.Windows.Forms.PaintEventArgs) event.
protected override void OnPaint(PaintEventArgs pevent)
Parameters
pevent
PaintEventArgsA System.Windows.Forms.PaintEventArgs that contains the event data.
ShowDropDownMenu()
public void ShowDropDownMenu()
WndProc(ref Message)
Processes Windows messages.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
Parameters
m
MessageThe Windows System.Windows.Forms.Message to process.