SmartButton
BinarySmartButton .NET control is an extended and feature-rich replacement for the standard .NET Framework Button control.
public class SmartButton : System.Windows.Forms.Control, IButtonControl
Inherits from / implements: System.Windows.Forms.Control, IButtonControl
Remarks
BinarySmartButton .NET offers the following rich features:
1. "XP-theme" style UI: The control presents its UI with the XP theme style look.
2. Support for displaying icon images with Alpha-channel information: You can now set button images with Icons without losing its alpha-channel information.
The standard .NET button control does not directly support displaying Icons with alpha-channel. Moreover, .NET standard button control does not display images when its FlatStyle is set to "System" in order to enable themed look.
BinarySmartButton presents its UI with XP themed look, also displaying icon images without losing the icon's alpha-channel information.
3. Menu Button style: The control supports a special MenuButton style. When set with this style, you can assign a set of MenuItems to the control, and the control will automatically display a drop-down menu just below the control so as to let your users choose a command from a list of numerous possible commands. This feature extends the button control's functionality by making a variety of commands to choose from and execute, instead of the traditional "one command" button functionality.
The control's drop-down menu can be displayed using our popular BinaryMenuItem .NET control that comes with this .NET assembly. This menu control lets you display Images and text in the drop-down menu along with the ever popular "Visual Studio .NET" style menu.
Alternatively, you could also simply use the standard MenuItem object to display the drop-down menu.
Either way, all you need to do is to set the ButtonStyle to MenuButton style and set the DropDownMenuItems property to array of your defined BinaryMenuItem .NET control or MenuItem objects.
Please refer to the detailed C# .NET sample demonstration program source code that accompanies the control package, to see how to use the various features of this control.
Members at a glance
SmartButton | — |
BorderColor | Gets or sets the color of the border. |
ButtonStyle | Gets or sets the button style. |
ContextMenuProperties | Gets or sets the user / custom defined settings for drawing the context menu properties. |
DefaultTheme | Gets or sets whether to use the default active theme. |
DialogResult | Implements IButtonControl.DialogResult property. |
DrawFocusRectangle | Gets or sets whether a focus rectangle needs to be drawn when the button control is in focus. |
DrawMenuButtonSeparator | Gets or sets a value indicating whether to draw the menu button separator. |
DropDownArrowMarkColor | Gets or sets the color of the drop-down arrow mark image that is displayed at the far right corner of the control, when the control is set to "ButtonStyles.MenuButton" style. |
DropDownMenuItems | Gets or sets the drop-down menu object of the control. |
EndColor | Gets or sets the end color. |
ForeColor | Gets or sets the control's text forecolor. |
Icon | Gets or sets the Icon that is displayed on the control. |
Image | Gets or sets the Image that is displayed on the control. |
IsRenderingTheme | Gets or sets a value indicating whether the control is rendering one of the built-in themes. |
LinearGradientRenderingAngle | Gets or sets the linear gradient rendering angle. |
MenuButtonSeparatorColor | Gets or sets the color of the menu button separator. |
MenuButtonSeparatorLineHeight | Gets or sets the Menu button separator line height. |
PushedEndColor | Gets or sets the end color for the pushed state of the control. |
PushedStartColor | Gets or sets the start color for the pushed state of the control. |
ShowDropDownArrow | Gets or sets whether to display a drop-down arrow mark when the control is set to "ButtonStyles.MenuButton" style. |
StartColor | Gets or sets the start color. |
Text | Gets or sets the text string that is displayed on the control. |
TextStringFormat | Gets or sets the user defined text string format to use. |
TransparentColor | Gets or sets the transparent color to use, when the Image property is set with a valid Bitmap. |
UseCustomDefinedPropertiesForRenderingContextMenu | Gets or sets a value indicating whether to use custom defined properties for rendering context menu. |
UseCustomTextStringFormat | Gets or sets a value indicating whether to use custom text string format. |
UseUserDefinedColorForArrowMark | Gets or sets a value indicating whether to use user defined color for Arrow mark.. |
UseUserDefinedColorForMenuButtonSeparator | Gets or sets a value indicating whether to use user defined color for menu button separator. |
XPTheme | Gets or sets the XP theme to emulate while drawing the control. |
Dispose | Overriden implementation. Kindly refer the base class (Controldocumentation. |
NotifyDefault | Implements IButtonControl.NotifyDefault method. |
OnClick | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnDpiChangedAfterParent | Repaints the button when it moves to a display with a different scale factor. |
OnEnter | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnHandleCreated | — |
OnKeyDown | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnKeyUp | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnLeave | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnMouseDown | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnMouseEnter | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnMouseLeave | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnMouseMove | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnMouseUp | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnPaint | Overridden implementation. Kindly refer the base class (Controldocumentation. |
OnParentChanged | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnSizeChanged | Overriden implementation. Kindly refer the base class (Controldocumentation. |
OnSystemColorsChanged | Refer to base class documentation. |
OnTextChanged | Overriden implementation. Kindly refer the base class (Controldocumentation. |
PerformClick | Implements IButtonControl.PerformClick method. |
ProcessMnemonic | Overriden implementation. Kindly refer the base class (Controldocumentation. |
WndProc | Processes Windows messages. |
OnAboutToTheShowContextMenuOnMenuButton | A specialized event that is raised just when the user clicks on the control (when it is of type MenuButton) and the assigned context menu is about to be shown. |
Constructors
SmartButton
No summary in the source yet.
Properties
BorderColor
Gets or sets the color of the border.
IsRenderingTheme property is set to false.ButtonStyle
Gets or sets the button style.
ButtonStyles enumeration.DefaultTheme
Gets or sets whether to use the default active theme.
XPTheme property value to a particular XP theme value. The default value is true.
DialogResult
Implements IButtonControl.DialogResult property.
DrawFocusRectangle
Gets or sets whether a focus rectangle needs to be drawn when the button control is in focus.
DropDownArrowMarkColor
Gets or sets the color of the drop-down arrow mark image that is displayed at the far right corner of the control, when the control is set to "ButtonStyles.MenuButton" style.
ControlText value.EndColor
Gets or sets the end color.
Value. The end color.
ForeColor
Gets or sets the control's text forecolor.
ControlText value.Icon
Gets or sets the Icon that is displayed on the control.
Icon images without losing its alpha-channel information. This means that you can display 32-bit
Icon objects which has the alpha-channel information (for e.g. drop-shadow information). Only
Icon objects are supported for displaying images with the drop-shadow effects (alpha-channel). Note: When this property is set to a valid
Icon object, the Image property is automatically set to null. Image
Gets or sets the Image that is displayed on the control.
Icon objects are supported for displaying the images with drop-shadow effects (alpha-channel). Note: When this property is set to a valid
Image object, the Icon property is automatically set to null. IsRenderingTheme
Gets or sets a value indicating whether the control is rendering one of the built-in themes.
LinearGradientRenderingAngle
Gets or sets the linear gradient rendering angle.
Value. The linear gradient rendering angle.
PushedEndColor
Gets or sets the end color for the pushed state of the control.
PushedStartColor
Gets or sets the start color for the pushed state of the control.
ShowDropDownArrow
Gets or sets whether to display a drop-down arrow mark when the control is set to "ButtonStyles.MenuButton" style.
StartColor
Gets or sets the start color.
Value. The start color.
Text
Gets or sets the text string that is displayed on the control.
TextStringFormat
Gets or sets the user defined text string format to use.
Value. The user defined custom text string format (i.e. StringFormat).
TransparentColor
Gets or sets the transparent color to use, when the Image property is set with a valid Bitmap.
UseCustomTextStringFormat
Gets or sets a value indicating whether to use custom text string format.
Value. true if to use custom text string format StringFormat; otherwise, false .
UseUserDefinedColorForArrowMark
Gets or sets a value indicating whether to use user defined color for Arrow mark..
Value. true if to use user defined color for Arrow mark; otherwise, false .
XPTheme
Gets or sets the XP theme to emulate while drawing the control.
XPThemes enumeration. The default value is "XPThemes.Blue".
Methods
Dispose
Overriden implementation. Kindly refer the base class (Controldocumentation.
NotifyDefault
Implements IButtonControl.NotifyDefault method.
OnClick
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnDpiChangedAfterParent
Repaints the button when it moves to a display with a different scale factor.
- e
- The event data.
OnEnter
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnHandleCreated
No summary in the source yet.
OnKeyDown
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnKeyUp
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnLeave
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnMouseDown
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnMouseEnter
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnMouseLeave
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnMouseMove
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnMouseUp
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnPaint
Overridden implementation. Kindly refer the base class (Controldocumentation.
OnParentChanged
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnSizeChanged
Overriden implementation. Kindly refer the base class (Controldocumentation.
OnSystemColorsChanged
Refer to base class documentation.
- e
OnTextChanged
Overriden implementation. Kindly refer the base class (Controldocumentation.
PerformClick
Implements IButtonControl.PerformClick method.
ProcessMnemonic
Overriden implementation. Kindly refer the base class (Controldocumentation.
WndProc
Processes Windows messages.
- m
- The Windows
Messageto process.