Class ButtonEditChildButton
The ButtonEditChildButton class is used by the ButtonEdit class as its child buttons. This class is derived from the System.Windows.Forms.Button class. You will not need to create this control directly as it will be created through the ButtonEdit class.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class ButtonEditChildButton : ButtonAdv, IThemeProvider, IVisualStyle, ISupportOffice2007Theme, ISupportThemeChanged, IMessageFilter
Remarks
The Buttons embedded in a ButtonEdit control need to abide by some constraints imposed by the layout and the settings of the ButtonEdit control. A customized Button control is needed for this purpose so that the relationship between the embedded child buttons and the parent ButtonEdit control can be established.
Customizing the Button class to provide features suitable for use inside the ButtonEdit control also provides ease of use for users. The ButtonEditChildButton implements additional properties such as ButtonType (that allow you to choose different types of commonly used button icons).
The ButtonEditChildButton also supports a listener model that notifies a listener when its size or alignment changes. The listener implements the IButtonEditParent interface to listen to these notifications.
Constructors
ButtonEditChildButton()
Initializes a new instance of the ButtonEditChildButton class.
Declaration
public ButtonEditChildButton()
Remarks
The ButtonEditChildButton is created and assigned the constraints that need to be in place for it to be embedded in a ButtonEdit control.
The ButtonType is initially set to Normal.
Properties
Appearance
Gets the appearance of the button control
Declaration
public ButtonAppearance Appearance { get; }
Property Value
Type |
---|
ButtonAppearance |
ButtonAlign
Gets or sets the alignment of the button with respect to the edit control.
Declaration
public ButtonAlignment ButtonAlign { get; set; }
Property Value
Type |
---|
ButtonAlignment |
Remarks
The possible values for the ButtonAlign property are the values of the ButtonAlignment enumeration. Using the values of the enumeration the value can be set to be at the right or the left of the edit control.
The default value for this property is Right
ButtonEditParent
Gets or sets the ButtonEdit control that is the parent and also the listener.
Declaration
public IButtonEditParent ButtonEditParent { get; set; }
Property Value
Type |
---|
IButtonEditParent |
Remarks
The ButtonEdit control implements the IButtonEditParent interface to act as a listener for change notifications from ButtonEditChildButton controls.
ButtonType
Gets / sets the ButtonTypes for this ButtonEditChildButton.
Declaration
public override ButtonTypes ButtonType { get; set; }
Property Value
Type |
---|
ButtonTypes |
Overrides
Remarks
Each of the ButtonTypes are associated with a commonly used button icon such as Up, down, undo, redo, etc. Choosing one of these types will set the Image property to one of the pre configured images.
This dependence between the ButtonType and the Image is not maintained strictly and is meant to be a help to developers. You can specify any image you want for the button through the Image property.
FirstRightButton
Declaration
protected bool FirstRightButton { get; set; }
Property Value
Type |
---|
System.Boolean |
FlatStyle
Gets or sets the display of the control when users move the mouse over the control and click.
Declaration
public FlatStyle FlatStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.FlatStyle |
Image
Gets or sets the image based on the button style for the control.
Declaration
public Image Image { get; set; }
Property Value
Type |
---|
System.Drawing.Image |
LastLeftButton
Declaration
protected bool LastLeftButton { get; set; }
Property Value
Type |
---|
System.Boolean |
Location
Gets or sets the Location property. Cannot be changed.
Declaration
public Point Location { get; set; }
Property Value
Type |
---|
System.Drawing.Point |
PreferredWidth
Gets or sets the preferred width; the width set by the use, treated as the width of the ButtonEditChildButton control.
Declaration
public int PreferredWidth { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
The Size property and the PreferredWidth property are maintained in sync and the Size property will not allow the width property to be changed. Changes to the width of the button have to be set through the PreferredWidth property.
Size
Gets or sets the Size property.
Declaration
public Size Size { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
Remarks
The Size property displays the size of the ButtonEditChildButton. The height of the button is fixed by the height of the ButtonEdit control and the width is specified through the PreferredWidth property.
TabStop
Gets or sets a value indicating whether the user can use the TAB key to give focus to the control.
Declaration
public bool TabStop { get; set; }
Property Value
Type |
---|
System.Boolean |
UseVisualStyle
Indicates whether to use visual styles.
Declaration
public override bool UseVisualStyle { get; set; }
Property Value
Type |
---|
System.Boolean |
Overrides
Remarks
Override required for hiding property from design time for user.
Methods
GetButtonImage(ButtonTypes)
Returns the image for the specified button type.
Declaration
protected virtual Image GetButtonImage(ButtonTypes buttonType)
Parameters
Type | Name | Description |
---|---|---|
ButtonTypes | buttonType | Button Types |
Returns
Type | Description |
---|---|
System.Drawing.Image | returns image |
Remarks
This dependence between the ButtonType and the Image is not maintained strictly and is meant to be a help to developers. You can specify any image you want for the button through the Image property.
OnClick(EventArgs)
Overrides the OnClick method. Set focus to parent control when needed.
Declaration
protected override void OnClick(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The click event data. |
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
Overrides
SetAppearance(ButtonAppearance)
Sets the appearance of the button control.
Declaration
public void SetAppearance(ButtonAppearance appearance)
Parameters
Type | Name | Description |
---|---|---|
ButtonAppearance | appearance | The appearance to be set. |
SetAppearance(ButtonAppearance, Color)
Sets the appearance of the button control.
Declaration
public void SetAppearance(ButtonAppearance appearance, Color metroColor)
Parameters
Type | Name | Description |
---|---|---|
ButtonAppearance | appearance | The appearance to be set. |
System.Drawing.Color | metroColor |