Class ComboDropDown
Implements
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class ComboDropDown : Control, IThemedControl, ISupportInitialize, INonClientPaintingSupport, ISupportOffice2007Theme, IVisualStyle
Constructors
ComboDropDown()
Creates a new instance of the ComboDropDown class.
Declaration
public ComboDropDown()
Fields
autoCompleteSuccess
Declaration
protected bool autoCompleteSuccess
Field Value
Type |
---|
System.Boolean |
cachedBackColor
Cached BackColor of ComboBox.
Declaration
protected Color cachedBackColor
Field Value
Type |
---|
System.Drawing.Color |
cachedForeColor
Cached BackColor of ComboBox.
Declaration
protected Color cachedForeColor
Field Value
Type |
---|
System.Drawing.Color |
initializing
Declaration
protected bool initializing
Field Value
Type |
---|
System.Boolean |
m_lastFoundIndex
Declaration
protected int m_lastFoundIndex
Field Value
Type |
---|
System.Int32 |
m_scrollersFrame
Declaration
protected ScrollersFrame m_scrollersFrame
Field Value
Type |
---|
ScrollersFrame |
Properties
AllowMouseWheelSelection
Gets or sets a value indicating whether selection changing can be done using mouse wheel rotation.
Declaration
public bool AllowMouseWheelSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Instead of handling mouse wheel event and handling it, user can set this bool property as per the needs. This property is used to work when the dropdown is not shown and changing selection through mouse wheel.
AllowQuickSelection
Gets or sets a value indicating if quick selection on mouse move is on.
Declaration
public bool AllowQuickSelection { get; set; }
Property Value
Type |
---|
System.Boolean |
BackColor
Gets or sets the back color. (overridden property)
Declaration
public override Color BackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
BackgroundImage
Specifies the BackgroundImage.(overridden property)
Declaration
public override Image BackgroundImage { get; set; }
Property Value
Type |
---|
System.Drawing.Image |
BackgroundImageLayout
Gets or sets background image layout.
Declaration
public ImageLayout BackgroundImageLayout { get; set; }
Property Value
Type |
---|
System.Windows.Forms.ImageLayout |
BeforeTouchSize
Gets/Sets Control size before touch enabled
Declaration
public Size BeforeTouchSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
Border3DStyle
Gets or sets the 3D border style for the control.
Declaration
public Border3DStyle Border3DStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Border3DStyle |
Remarks
This property is used only when BorderStyle is Fixed3D.
BorderSides
Gets or sets the border sides for which you want the 3D border style applied.
Declaration
public Border3DSide BorderSides { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Border3DSide |
Remarks
This property is used only when BorderStyle is Fixed3D.
CaseSensitiveAutocomplete
Indicates whether the search in autocomplete is case-sensitive.
Declaration
public bool CaseSensitiveAutocomplete { get; set; }
Property Value
Type |
---|
System.Boolean |
CharacterCasing
Specifies the ComboBoxBase control modifies the case of characters as they are typed.
Declaration
public virtual CharacterCasing CharacterCasing { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.CharacterCasing | One of the System.Windows.Forms.CharacterCasing enumeration values that specifies whether the ComboBoxBase control modifies the case of characters. The default is CharacterCasing.Normal. |
ComboBoxRenderer
Update the renderer for Office2016 style.
Declaration
protected virtual ComboBoxAdvRenderer ComboBoxRenderer { get; }
Property Value
Type |
---|
ComboBoxAdvRenderer |
ContextMenu
Gets or sets the ContextMenu. (overridden property)
Declaration
public override ContextMenu ContextMenu { get; set; }
Property Value
Type |
---|
System.Windows.Forms.ContextMenu |
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Type |
---|
System.Windows.Forms.CreateParams |
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
Type |
---|
System.Drawing.Size |
DropDownButton
Returns the DropDownButton used to draw the drop-down portion of the combo.
Declaration
public DropDownButton DropDownButton { get; }
Property Value
Type |
---|
DropDownButton |
DropDownButtonHeight
Gets or sets the height of the drop-down button.
Declaration
protected int DropDownButtonHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
DropDownStyle
Gets or sets the style of the combo box.
Declaration
public ComboBoxStyle DropDownStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ComboBoxStyle | One of the System.Windows.Forms.ComboBoxStyle values. The default is System.Windows.Forms.ComboBoxStyle.DropDown. |
Remarks
The DropDownStyle property controls the interface that is presented to the user. You can enter a value that allows for a simple drop-down list box, where the list always displays a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down, or the default drop-down list box where the text portion is editable and the user must press the arrow key to view the list.
DropDownWidth
Gets or sets the drop-down's width.
Declaration
public int DropDownWidth { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
The value provided here will be used to determine the width of the drop-down portion. If you do not set a value explicitly, the width of this control will be used as the preferred width.
To reset your settings on this property, call the ResetDropDownWidth() method.
DroppedDown
Indicates whether the combo box is displaying its drop-down portion.
Declaration
public bool DroppedDown { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the drop-down portion is displayed; False otherwise. The default is False. |
EditPortionHeight
Gets or sets the height of the edit portion.
Declaration
protected int EditPortionHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
EnableTouchMode
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Scale factor will be updated automatically if scalefactor is equal to 1
FlatBorderColor
Gets or sets the color with which the flat border should be drawn.
Declaration
public virtual Color FlatBorderColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | A color value. Default is SystemColors.ControlDark. |
Remarks
This is also the color used to draw the border when the Style property is set to OfficeXP or Office2003.
FlatStyle
Gets or sets the flat style appearance of the combo box control.
Declaration
public virtual ComboFlatStyle FlatStyle { get; set; }
Property Value
Type | Description |
---|---|
ComboFlatStyle | One of the ComboFlatStyle values. The default value is Standard. |
Remarks
When you specify System and the application is run in Windows XP, themes will be used to draw this control.
Use IsThemedOS and IsThemeActive to determine if themes are on during run-time.
Focused
Specifies whether the control is focused. (overridden property)
Declaration
public override bool Focused { get; }
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 |
ForeColor
Gets or sets the ForeColor. (overridden property)
Declaration
public override Color ForeColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
GrayOnReadOnly
Gets or sets a value indicating to show the Gray BackColor on ReadOnly is set.
Declaration
public bool GrayOnReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
IgnorePopupValueChange
Declaration
protected bool IgnorePopupValueChange { get; set; }
Property Value
Type |
---|
System.Boolean |
IgnoreThemeBackground
Indicates whether the control will ignore the theme`s background color and draw the BackColor instead.
Declaration
public virtual bool IgnoreThemeBackground { get; set; }
Property Value
Type |
---|
System.Boolean |
IsInitializing
Gets a value indicating whether this instance is initializing.
Declaration
public bool IsInitializing { get; }
Property Value
Type |
---|
System.Boolean |
IsPopUpControlType
Check whether the ComboBox is ComboDropDown or ComboBoxAdv
Declaration
public bool IsPopUpControlType { get; }
Property Value
Type |
---|
System.Boolean |
LastCommittedText
Declaration
protected string LastCommittedText { get; set; }
Property Value
Type |
---|
System.String |
MatchFirstCharacterOnly
This property defines the autocomplete behavior in DropDownList mode.
Declaration
public bool MatchFirstCharacterOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
This property is used when the DropDownStyle is set to DropDownList only.
MaxLength
Gets or sets the maximum number of characters allowed in the editable portion of a combo box.
Declaration
public int MaxLength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The maximum number of characters the user can enter. Default value is 32767. |
MetroBorderColor
Gets or sets the BorderColor for metro style
Declaration
public Color MetroBorderColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
MetroColor
Gets or sets the metrocolor.
Declaration
public Color MetroColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
NeedLayout
Indicates whether the layout method needs to be called to layout the combo elements.
Declaration
public bool NeedLayout { get; }
Property Value
Type |
---|
System.Boolean |
Remarks
Internal method. You will not have to call this property explicitly.
NumberOnly
Indicates whether users should be forced to enter numbers.
Declaration
public virtual bool NumberOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to force numbers; False otherwise. |
Office2007ColorTheme
Gets or sets office 2007 color theme.
Declaration
public Office2007Theme Office2007ColorTheme { get; set; }
Property Value
Type |
---|
Office2007Theme |
Office2010ColorTheme
Gets or sets office 2010 color theme.
Declaration
public Office2010Theme Office2010ColorTheme { get; set; }
Property Value
Type |
---|
Office2010Theme |
PopupContainer
Returns the PopupControlContainer used to host the drop-down list.
Declaration
public PopupControlContainer PopupContainer { get; }
Property Value
Type |
---|
PopupControlContainer |
PopupControl
The System.Windows.Forms.Control that will be used in the drop-down portion.
Declaration
public virtual Control PopupControl { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Control | A System.Windows.Forms.Control derived instance. |
PreventHeightChange
Indicates whether the Height property of the control can be changed.
Declaration
protected bool PreventHeightChange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to prevent height change; False otherwise . |
Remarks
Note that this property will be frequently set and reset within the control layout. You can use this temporarily to force a particular height on the control.
ReadOnly
Indicates whether the text in the edit portion can be changed.
Declaration
public virtual bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | If True, the edit portion is not editable by the user; False otherwise. |
RightToLeft
Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts.
Declaration
public override RightToLeft RightToLeft { get; set; }
Property Value
Type |
---|
System.Windows.Forms.RightToLeft |
Style
Gets or sets an advanced appearance and behavior for this control.
Declaration
public VisualStyle Style { get; set; }
Property Value
Type | Description |
---|---|
VisualStyle | One of the VisualStyle values. Default is VisualStyle.Default. |
Remarks
When a non-default style is specified here, it will override the other settings of the control such as BorderSides and FlatStyle. The FlatBorderColor is used to draw the borders for the office styles, when the control is not active.
The Office2003 style behaves the same as OfficeXP in non-XP systems.
SuppressDropDownEvent
Indicates whether to suppress the DropDown Event
Declaration
public bool SuppressDropDownEvent { get; set; }
Property Value
Type |
---|
System.Boolean |
Text
Gets or sets the text associated with this control.
Declaration
public override string Text { get; set; }
Property Value
Type |
---|
System.String |
Remarks
When in DropDownList mode, setting this property will also validate the new value against the attached popup control.
TextAlign
Gets or sets the alignment of text in this control.
Declaration
public virtual HorizontalAlignment TextAlign { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.HorizontalAlignment | One of the System.Windows.Forms.HorizontalAlignment enumeration values that specifies how text is aligned in the control. The default is HorizontalAlignment.Left. |
Remarks
You can use this property to align the text within a ComboBoxBase to match the layout of text on your form. For example, if your controls are all located on the right side of the form, you can set the TextAlign property to HorizontalAlignment.Right and the text will be aligned along the right side of the control instead of the default left alignment.
TextBox
Returns the System.Windows.Forms.TextBox used to draw the editable text portion of the combo.
Declaration
public TextBox TextBox { get; }
Property Value
Type |
---|
System.Windows.Forms.TextBox |
UseBackColor
Gets or sets a value to have effect of BackColor
Declaration
public bool UseBackColor { get; set; }
Property Value
Type |
---|
System.Boolean |
UseMetroButtonColor
Declaration
public bool UseMetroButtonColor { get; set; }
Property Value
Type |
---|
System.Boolean |
UseMetroColorsInActiveMode
Gets or sets a value indicating whether [use metro colors in active mode].
Declaration
public bool UseMetroColorsInActiveMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
UseMnemonic
Declaration
public bool UseMnemonic { get; set; }
Property Value
Type |
---|
System.Boolean |
UseOffice2007ColorsInActiveMode
Gets or sets a value indicating whether [use office2007 colors in active mode].
Declaration
public bool UseOffice2007ColorsInActiveMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
ApplyScaleToControl(Single)
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | value to scale the factor based upon. |
AttachPopupControl()
Declaration
protected virtual void AttachPopupControl()
AttachScrollersFrame(Control)
Attaches scrollersFrame to the PopupControl.
Declaration
protected void AttachScrollersFrame(Control control)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | control |
CommitChanges()
Declaration
protected virtual void CommitChanges()
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type |
---|
System.Windows.Forms.AccessibleObject |
CreateDropDownButton()
Called once to create a DropDownButton for the drop-down button portion of the combo.
Declaration
protected virtual DropDownButton CreateDropDownButton()
Returns
Type | Description |
---|---|
DropDownButton | A new instance of a DropDownButton. |
Remarks
Override this method to provide a custom implementation of a DropDownButton. InitDropDownButton(DropDownButton)
CreatePopupContainer()
Called once to create a PopupControlContainer that will host the drop-down list.
Declaration
protected virtual PopupControlContainer CreatePopupContainer()
Returns
Type | Description |
---|---|
PopupControlContainer | A new instance of a PopupControlContainer. |
Remarks
Override this method to provide a custom implementation of the PopupControlContainer. InitPopupContainer()
CreateScrollersFrame()
Creates new instance of the scrollersFrame.
Declaration
protected ScrollersFrame CreateScrollersFrame()
Returns
Type |
---|
ScrollersFrame |
CreateTextBox()
Called once to create a System.Windows.Forms.TextBox for the editable text portion of the combo.
Declaration
protected virtual TextBox CreateTextBox()
Returns
Type | Description |
---|---|
System.Windows.Forms.TextBox | A new instance of a System.Windows.Forms.TextBox. |
Remarks
Override this method to provide a custom implementation of a text box. InitTextBox()
DefWndProc(ref Message)
Sends the specified message to the default windows procedure.
Declaration
protected override void DefWndProc(ref Message msg)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | msg |
DetachPopupControl(Boolean)
Declaration
protected virtual void DetachPopupControl(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
DetachScrollersFrame()
Detaches scrollersFrame from the PopupControl.
Declaration
protected void DetachScrollersFrame()
DetermineHeightsBasedOnFont(Graphics, ref Int32)
Determines the heights of certain portions of this control.
Declaration
protected virtual void DetermineHeightsBasedOnFont(Graphics g, ref int textAreaHeight)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | A System.Drawing.Graphics object. |
System.Int32 | textAreaHeight | A reference variable through which to return the height for the text area. |
Remarks
Make sure to call the base class when you override this method.
This method expects you to return a height for the text area through the reference variable, set the height of this control (if not in ComboBoxStyle.Simple mode) and the height of the drop-down button (DropDownButtonHeight).
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
DrawBorderAndBackground(Graphics, Rectangle)
Draws the border and background of the control.
Declaration
protected virtual void DrawBorderAndBackground(Graphics g, Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
System.Drawing.Rectangle | rect | The System.Drawing.Rectangle within which to draw. |
Remarks
This method is used to draw the border around the text area (when called from DrawEditPortionBorderAndBackground(PaintEventArgs) method) and around the list box area (when in ComboBoxStyle.Simple mode and called from the DrawListPortion(PaintEventArgs) method).
This method uses themes to draw if necessary or calls DrawUnThemedBackground(Graphics, Rectangle) and DrawUnThemedBorder(Graphics, Rectangle) to draw the background and border.
DrawDropDownPortion(PaintEventArgs)
Called from the Paint event handler to draw the drop-down button.
Declaration
protected virtual void DrawDropDownPortion(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs from the Paint event. |
DrawEditPortion(PaintEventArgs)
Called from the Paint event handler to draw the text portion.
Declaration
protected virtual void DrawEditPortion(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs from the Paint event. |
Remarks
This method calls the DrawListModeEditPortion(PaintEventArgs, Color, Color, Boolean) method to draw the edit portion only when in ComboBoxStyle.DropDownList mode or when in design-mode.
DrawEditPortionBorderAndBackground(PaintEventArgs)
Called from the Paint event handler to draw the edit portion's border and background.
Declaration
protected virtual void DrawEditPortionBorderAndBackground(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs from the Paint event. |
Remarks
This method calls the DrawBorderAndBackground(Graphics, Rectangle) method with the appropriate dimension to draw the border around the text portion.
DrawListModeEditPortion(PaintEventArgs, Color, Color, Boolean)
Called from DrawEditPortion(PaintEventArgs) to draw the text area when in ComboBoxStyle.DropDownList mode.
Declaration
protected virtual void DrawListModeEditPortion(PaintEventArgs e, Color highlightBG, Color highlightText, bool drawFocusRect)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs from the Paint event. |
System.Drawing.Color | highlightBG | The background color for the highlight. |
System.Drawing.Color | highlightText | The text color for the highlight. |
System.Boolean | drawFocusRect | Indicates whether to draw a focus rectangle. |
DrawListPortion(PaintEventArgs)
Called from the Paint event handler to draw the list portion.
Declaration
protected virtual void DrawListPortion(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs from the Paint event. |
Remarks
This method draws the list portion when in ComboBoxStyle.Simple mode.
DrawUnThemedBackground(Graphics, Rectangle)
Draws the unthemed background of this control.
Declaration
protected virtual void DrawUnThemedBackground(Graphics g, Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
System.Drawing.Rectangle | rect | The System.Drawing.Rectangle within which to draw. |
Remarks
Called by DrawBorderAndBackground(Graphics, Rectangle) to draw the background when not in themes mode.
DrawUnThemedBorder(Graphics, Rectangle)
Draws the unthemed border of this control.
Declaration
protected virtual void DrawUnThemedBorder(Graphics g, Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics context. |
System.Drawing.Rectangle | rect | The System.Drawing.Rectangle within which to draw. |
Remarks
Called by DrawBorderAndBackground(Graphics, Rectangle) to draw the border when not in themes mode.
FindItem(String, Boolean, Int32, Boolean)
Declaration
protected virtual int FindItem(string prefix, bool select, int start, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | |
System.Boolean | select | |
System.Int32 | start | |
System.Boolean | ignoreCase |
Returns
Type |
---|
System.Int32 |
ForwardKeyMessageToPopupControl(Int32, IntPtr, IntPtr)
Forwards the key message to the attached PopupControl.
Declaration
protected virtual void ForwardKeyMessageToPopupControl(int msg, IntPtr wparam, IntPtr lparam)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | msg | The message id. |
System.IntPtr | wparam | The first message parameter. |
System.IntPtr | lparam | The second message parameter. |
GetComboBoxDropDownWidth()
Returns the width for the combo box drop-down button.
Declaration
protected virtual int GetComboBoxDropDownWidth()
Returns
Type | Description |
---|---|
System.Int32 | The button width. |
GetEmbeddedChildBounds()
The bounds for the control that is associated with this popup when in DropDownStyle.Simple mode.
Declaration
protected virtual Rectangle GetEmbeddedChildBounds()
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The bounds for the embedded control. |
GetEmbeddedChildBounds(Int32)
Overloaded. The bounds for the control that is associated with this popup when in DropDownStyle.Simple mode.
Declaration
protected virtual Rectangle GetEmbeddedChildBounds(int comboHeight)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | comboHeight | The height of the combo control. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The bounds for the embedded control. |
GetOfficeStyleComboBoxDropDownWidth()
Returns the width for the combo box drop-down button when office style is on.
Declaration
protected virtual int GetOfficeStyleComboBoxDropDownWidth()
Returns
Type | Description |
---|---|
System.Int32 | The button width. |
GetPopupControlItemText(Int32)
Declaration
protected virtual string GetPopupControlItemText(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.String |
GetPopupText()
Declaration
protected virtual string GetPopupText()
Returns
Type |
---|
System.String |
HasListInterface()
Declaration
protected virtual bool HasListInterface()
Returns
Type |
---|
System.Boolean |
HidePopup()
Hides the drop-down list box.
Declaration
protected virtual void HidePopup()
InitDropDownButton(DropDownButton)
Called to initialize the DropDownButton used in the drop-down button portion of the combo.
Declaration
protected virtual void InitDropDownButton(DropDownButton ddButton)
Parameters
Type | Name | Description |
---|---|---|
DropDownButton | ddButton |
Remarks
This method is called once to initialize the DropDownButton used to draw the drop-down portion of the combo.
Make sure to call the base class when you override this method for default initialization.
CreateDropDownButton()InitPopupContainer()
Called to initialize the drop-down container.
Declaration
protected virtual void InitPopupContainer()
Remarks
This method is called once to initialize the drop-down container that hosts the drop-down list. Use the PopupContainer property to get a reference to the PopupControlContainer from inside an override of this method.
Make sure to call the base class when you override this method for default initialization.
CreatePopupContainer()InitScrollersFrame()
Inits the scrollers frame.
Declaration
protected virtual void InitScrollersFrame()
InitTextBox()
Called to initialize the System.Windows.Forms.TextBox used in the editable text portion.
Declaration
protected virtual void InitTextBox()
Remarks
This method is called once to initialize the text box used to draw the editable portion of the combo. Use the TextBox property to get a reference to the text box from inside a override of this method.
Make sure to call the base class when you override this method for default initialization.
CreateTextBox()IsInputChar(Char)
Declaration
protected override bool IsInputChar(char charCode)
Parameters
Type | Name | Description |
---|---|---|
System.Char | charCode |
Returns
Type |
---|
System.Boolean |
IsInputKey(Keys)
Declaration
protected override bool IsInputKey(Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
IsTextValid(String)
Declaration
protected virtual bool IsTextValid(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text |
Returns
Type |
---|
System.Boolean |
IsValidIndex(Int32)
Declaration
protected virtual bool IsValidIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.Boolean |
MoveSelelctionInPopupControl(Boolean)
Moves the current selection in the attached PopupControl.
Declaration
protected virtual void MoveSelelctionInPopupControl(bool up)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | up | Indicates whether to move up. |
OnBeforePopup()
Called before the popup gets dropped down.
Declaration
protected virtual void OnBeforePopup()
OnBeginInit()
Declaration
protected virtual void OnBeginInit()
OnBorder3DStyleChanged(EventArgs)
Raises the Border3DStyleChanged event.
Declaration
protected virtual void OnBorder3DStyleChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorder3DStyleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnBorder3DStyleChanged in a derived class, be sure to call the base class's OnBorder3DStyleChanged method so that registered delegates receive the event.
OnBorderSidesChanged(EventArgs)
Raises the BorderSidesChanged event.
Declaration
protected virtual void OnBorderSidesChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorderSidesChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OmBorderSidesChanged in a derived class, be sure to call the base class's OnBorderSidesChanged method so that registered delegates receive the event.
OnDropDown(EventArgs)
Raises the Drop-Down event.
Declaration
protected virtual void OnDropDown(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnDropDown method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnDropDown in a derived class, be sure to call the base class's OnDropDown method so that registered delegates receive the event.
OnDropDownStyleChanged(EventArgs)
Raises the DropDownStyleChanged event.
Declaration
protected virtual void OnDropDownStyleChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see "Raising an Event".
The DropDownStyleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnDropDownStyleChanged in a derived class, be sure to call the base class's OnDropDownStyleChanged method so that registered delegates receive the event.
OnEnabledChanged(EventArgs)
Declaration
protected override void OnEnabledChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnEndInit()
Declaration
protected virtual void OnEndInit()
OnEnter(EventArgs)
Declaration
protected override void OnEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnFontChanged(EventArgs)
Font chnaged
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnGotFocus(EventArgs)
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e |
OnKeyPress(KeyPressEventArgs)
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyPressEventArgs | e |
OnLayout(LayoutEventArgs)
Declaration
protected override void OnLayout(LayoutEventArgs levent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.LayoutEventArgs | levent |
OnLostFocus(EventArgs)
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseUpOnQuickSelect()
Declaration
protected virtual void OnMouseUpOnQuickSelect()
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnNewListItemKeyedIn(Int32)
Declaration
protected virtual bool OnNewListItemKeyedIn(int indexFound)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | indexFound |
Returns
Type |
---|
System.Boolean |
OnNoChangeDetectedOnPopupClosed()
Declaration
protected virtual void OnNoChangeDetectedOnPopupClosed()
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e |
OnPopupClosed(PopupClosedEventArgs)
Called when the popup is closed.
Declaration
protected virtual void OnPopupClosed(PopupClosedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
PopupClosedEventArgs | e |
OnReadOnlyChanged(EventArgs)
Raises the ReadOnlyChanged event.
Declaration
protected virtual void OnReadOnlyChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see "Raising an Event".
The ReadOnlyChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnReadOnlyChanged in a derived class, be sure to call the base class's OnReadOnlyChanged method so that registered delegates receive the event.
OnSelectionChangeCommitted(EventArgs)
Raises the SelectionChangeCommitted event.
Declaration
protected virtual void OnSelectionChangeCommitted(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnSelectionChangeCommitted method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnSelectionChangeCommitted in a derived class, be sure to call the base class's OnSelectionChangeCommitted method so that registered delegates receive the event.
OnSelectionChangedOnPopupClose()
Declaration
protected virtual void OnSelectionChangedOnPopupClose()
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnSystemColorsChanged(EventArgs)
Overridden. See System.Windows.Forms.Control.OnSystemColorsChanged(System.EventArgs).
Declaration
protected override void OnSystemColorsChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnTabStopChanged(EventArgs)
Declaration
protected override void OnTabStopChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnTextBoxKeyUp(KeyEventArgs)
Declaration
protected virtual void OnTextBoxKeyUp(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e |
OnThemeChanged(EventArgs)
Raises the ThemeChanged event.
Declaration
protected virtual void OnThemeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnThemeChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnThemeChanged in a derived class, be sure to call the base class's OnThemeChanged method so that registered delegates receive the event.
OnValidated(EventArgs)
Declaration
protected override void OnValidated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OtherChangesMade()
Indicates whether another change was made except text changing in control.
Declaration
protected virtual bool OtherChangesMade()
Returns
Type | Description |
---|---|
System.Boolean | True if changes were detected; false otherwise. |
PerformAllowNewText(Message)
Verifies whether new text is allowed to be entered from native message.
Declaration
public virtual bool PerformAllowNewText(Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m | The message. |
Returns
Type | Description |
---|---|
System.Boolean | True if the message is handled. |
PerformTextAutoComplete(KeyPressEventArgs)
Performs auto complete in the text area.
Declaration
protected virtual void PerformTextAutoComplete(KeyPressEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyPressEventArgs | e | The arguments of the KeyPress event. |
ProcessCmdKey(ref Message, Keys)
Declaration
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | msg | |
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
ProcessDDMouseDown()
Declaration
protected virtual void ProcessDDMouseDown()
ProcessDDMouseDown(MouseEventArgs)
Declaration
protected virtual void ProcessDDMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
ProcessDialogKey(Keys)
Declaration
protected override bool ProcessDialogKey(Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
ProcessMouseMove(MouseEventArgs, Boolean)
Processes mouse moves on the combo-box and textbox area.
Declaration
protected virtual void ProcessMouseMove(MouseEventArgs e, bool fromTextBox)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | The event args of the MouseMove event. |
System.Boolean | fromTextBox | Indicates whether this was called due to mouse move in the text area or combo. |
ProcessPopupControlMouseMove(Object, MouseEventArgs)
Declaration
protected virtual void ProcessPopupControlMouseMove(object sender, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.Windows.Forms.MouseEventArgs | e |
RaiseSelectionChangeCommitted()
Raises the SelectionChangeCommitted event.
Declaration
public void RaiseSelectionChangeCommitted()
Remarks
The event will be fired usually when the user commits selection change. You could use this method to raise an event manually for a custom scenario.
ResetBackColor()
Resets the System.Windows.Forms.Control.BackColor property to its default value.
Declaration
public override void ResetBackColor()
ResetDropDownWidth()
Resets the DropDownWidth property's value to its default.
Declaration
public void ResetDropDownWidth()
ResetFlatBorderColor()
Declaration
protected void ResetFlatBorderColor()
ResetToLatestCommittedText()
Declaration
protected virtual void ResetToLatestCommittedText()
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | |
System.Int32 | y | |
System.Int32 | width | |
System.Int32 | height | |
System.Windows.Forms.BoundsSpecified | specified |
SetNeedLayout(Boolean)
Forces laying out of the combo elements within the next Paint Message handler.
Declaration
protected virtual void SetNeedLayout(bool needLayout)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | needLayout | True to force; False to prevent layout. |
SetPopupText(String)
Declaration
protected virtual void SetPopupText(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
SetSelectedText(String, Int32)
Declaration
protected virtual void SetSelectedText(string text, int foundIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | |
System.Int32 | foundIndex |
SetText(String, Boolean)
Declaration
protected virtual void SetText(string newValue, bool fireChangeEvent)
Parameters
Type | Name | Description |
---|---|---|
System.String | newValue | |
System.Boolean | fireChangeEvent |
SetTextBoxBounds(Rectangle)
Declaration
protected virtual void SetTextBoxBounds(Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rect |
ShouldSerializeBackColor()
Declaration
protected bool ShouldSerializeBackColor()
Returns
Type |
---|
System.Boolean |
ShouldSerializeDropDownWidth()
Indicates whether the DropDownWidth property's value is the default.
Declaration
public bool ShouldSerializeDropDownWidth()
Returns
Type | Description |
---|---|
System.Boolean | True if the value is not the default; false otherwise. |
ShouldSerializeFlatBorderColor()
Declaration
protected bool ShouldSerializeFlatBorderColor()
Returns
Type |
---|
System.Boolean |
ShowPopup()
Shows the drop-down.
Declaration
protected virtual void ShowPopup()
UnInitTextBox()
Declaration
protected virtual void UnInitTextBox()
UpdateDropDownButtonBounds()
Updates the bounds of the drop-down button bounds.
Declaration
protected virtual void UpdateDropDownButtonBounds()
Remarks
Sets the bounds based on the value returned by the GetComboBoxDropDownWidth() method.
UpdateEditPortionBounds(Int32)
Updates the internal textbox's bounds and visibility based on the DropDownStyle.
Declaration
protected virtual void UpdateEditPortionBounds(int textAreaHeight)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | textAreaHeight | The height of the text area. |
UpdateLayout(Graphics)
Declaration
public void UpdateLayout(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g |
UpdatePopupBounds()
Declaration
protected virtual void UpdatePopupBounds()
UpdatePopupControl()
Updates the attached popup control based on the current Text property.
Declaration
public virtual void UpdatePopupControl()
Remarks
Call this method to update the popup list box, for example, with the latest text value that the user might have entered. This is useful when you enable auto completion in the text area and force the list box's SelectedValue to be updated to the latest text value in this control's Validated event.
UpdatePopupControlBounds()
Updates the attached PopupControl's bounds.
Declaration
protected virtual void UpdatePopupControlBounds()
Remarks
The base class updates the PopupControl's bounds and visibility based on the DropDownStyle settings.
UpdatePopupControlRelationship()
Updates the attached PopupControl's parent-child relationship.
Declaration
protected virtual void UpdatePopupControlRelationship()
Remarks
If in ComboBoxStyle.Simple mode, the base class implementation parents the Popup Control to the combo itself. Otherwise, it parents the PopupContainer to the Popup Control.
UpdateText(Boolean)
Updates the Text property based on the PopupControl's selected value.
Declaration
public virtual bool UpdateText(bool fireEvent)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | fireEvent | Indicates whether the SelectionChangeCommitted event should be fired if the text is changed. |
Returns
Type | Description |
---|---|
System.Boolean | True if the SelectionChangeCommitted event was fired; False otherwise. |
Remarks
You normally do not have to call this method. However when you programmatically update the SelectedValue of a plug in the list control, you might have to call this method to update the combo's text based on that new value.
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
Events
Border3DStyleChanged
Occurs when border's 3D style is changed.
Declaration
public event EventHandler Border3DStyleChanged
Event Type
Type |
---|
System.EventHandler |
BorderSidesChanged
Fired when BorderSides are changed.
Declaration
public event EventHandler BorderSidesChanged
Event Type
Type |
---|
System.EventHandler |
DropDown
Occurs before the drop-down portion is shown.
Declaration
public event EventHandler DropDown
Event Type
Type |
---|
System.EventHandler |
DropDownStyleChanged
Occurs when the DropDownStyle of the combo changes.
Declaration
public event EventHandler DropDownStyleChanged
Event Type
Type |
---|
System.EventHandler |
ReadOnlyChanged
Occurs when the ReadOnly property of the combo changes.
Declaration
public event EventHandler ReadOnlyChanged
Event Type
Type |
---|
System.EventHandler |
SelectionChangeCommitted
Occurs when the user selects a new text for the combo in one of many possible ways.
Declaration
public event EventHandler SelectionChangeCommitted
Event Type
Type |
---|
System.EventHandler |
Remarks
This event will be fired for the following cases:
- When the user selects a new item in the list box by clicking or pressing Enter.
- When the user Tabs out of the combo after changing the current text and Validation was successful.
ThemeChanged
Fired when the ThemesEnabled property changes.
Declaration
public event EventHandler ThemeChanged
Event Type
Type |
---|
System.EventHandler |
Explicit Interface Implementations
INonClientPaintingSupport.NonClientPaint(PaintEventArgs, Rectangle, Rectangle)
Declaration
IntPtr INonClientPaintingSupport.NonClientPaint(PaintEventArgs e, Rectangle displayRect, Rectangle windowRectInScreen)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | |
System.Drawing.Rectangle | displayRect | |
System.Drawing.Rectangle | windowRectInScreen |
Returns
Type |
---|
System.IntPtr |
ISupportOffice2007Theme.EnableOffice2007Style()
Declaration
void ISupportOffice2007Theme.EnableOffice2007Style()
IThemedControl.ThemesEnabled
Indicates whether themes are enabled for this control.
Declaration
bool IThemedControl.ThemesEnabled { get; set; }
Returns
Type |
---|
System.Boolean |
IVisualStyle.VisualTheme
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Type |
---|
System.String |