Table of Contents

Class DropDownButton

Namespace
NanoByte.Common.Controls
Assembly
NanoByte.Common.WinForms.dll

A Button with an additional drop-down menu.

public class DropDownButton : Button
Inheritance
DropDownButton
Extension Methods

Constructors

DropDownButton()

public DropDownButton()

Properties

ContextMenuStrip

Gets or sets the ContextMenuStrip associated with this control.

[Browsable(false)]
public override ContextMenuStrip? ContextMenuStrip { get; set; }

Property Value

ContextMenuStrip

The ContextMenuStrip for this control, or null if there is no 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 Size

The custom-sized area for a control.

Returns

Size

An ordered pair of type 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 Keys

One of the Keys values.

Returns

bool

true if the specified key is a regular input key; otherwise, false.

OnEnabledChanged(EventArgs)

Raises the EnabledChanged event.

protected override void OnEnabledChanged(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnGotFocus(EventArgs)

Raises the GotFocus event.

protected override void OnGotFocus(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnKeyDown(KeyEventArgs)

Raises the OnKeyUp(KeyEventArgs) event.

protected override void OnKeyDown(KeyEventArgs kevent)

Parameters

kevent KeyEventArgs

A KeyEventArgs that contains the event data.

OnKeyUp(KeyEventArgs)

Raises the OnKeyUp(KeyEventArgs) event.

protected override void OnKeyUp(KeyEventArgs kevent)

Parameters

kevent KeyEventArgs

A KeyEventArgs that contains the event data.

OnLostFocus(EventArgs)

Raises the OnLostFocus(EventArgs) event.

protected override void OnLostFocus(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseDown(MouseEventArgs)

Raises the OnMouseDown(MouseEventArgs) event.

protected override void OnMouseDown(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseEnter(EventArgs)

Raises the OnMouseEnter(EventArgs) event.

protected override void OnMouseEnter(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnMouseLeave(EventArgs)

Raises the OnMouseLeave(EventArgs) event.

protected override void OnMouseLeave(EventArgs e)

Parameters

e EventArgs

OnMouseUp(MouseEventArgs)

Raises the OnMouseUp(MouseEventArgs) event.

protected override void OnMouseUp(MouseEventArgs mevent)

Parameters

mevent MouseEventArgs

A MouseEventArgs that contains the event data.

OnPaint(PaintEventArgs)

Raises the OnPaint(PaintEventArgs) event.

protected override void OnPaint(PaintEventArgs pevent)

Parameters

pevent PaintEventArgs

A 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 Message

The Windows Message to process.