How to use the control as a Split Button |
|
Split buttons are buttons that are usually associated to a drop-down menu. Pressing the button should carry out an action; alternatively, clicking on arrow to the right or to the bottom of the "split" should display different but similar actions that can be performed by clicking on the menu item. The screenshot below shows a menu item displayed after clicking on the arrow of the split button. Split buttons can be vertical as in the image below or horizontal as in the image below First of all, set the Style property value to STYLE_SPLIT_BUTTON (For more details on button styles, see How to change the button style. For more details on setting button properties, see How to use the control in your projects). You can decide the orientation of the split through the SplitButtonType property and its size through the SplitButtonSizePerc property. You can define the color of the split line through the SplitButtonHighlightColor and SplitButtonShadowColor properties. By default, the arrow of the split button is made-up of a triangle whose color can be set through the SplitButtonArrowColor property: if the default arrow shouldn't be enough for you, you can set your own arrow picture through the SplitButtonPicture property. In both cases, the arrow positioning can be fine-tuned through the SplitButtonArrowOffsetX and SplitButtonArrowOffsetY properties. The drop-down menu is not embedded inside the control and must be displayed using one of the available Windows API after catching the SplitButtonClick event; other events are generated by the control when the mouse enters and leaves the split area: the SplitButtonMouseIn and the SplitButtonMouseOut events respectively.
The simplest way to change options applied to the Split Button style is to use, inside 3D Button Visual Editor, the Split Button tab. At run-time each of these properties can be referenced by name. Note: The images below have hot links to take you to explanations of the various button settings.
|