|
||
|
vbAccelerator Scroll Buttons ControlCreate scroll bars with integral push and check-buttons This control provides an implementation of an API scroll bar control which can be extended to display completely configurable buttons at either end of the scroll bar. This way you can add extra functionality like the VB code editor's Procedure/Full Module view buttons or zoom in and out buttons like those seen in music applications like Cakewalk and Acid. In UseTo set up a scroll bar with buttons, you need an ImageList source for the buttons (note that this control, unlike some of the API-based controls elsewhere on the site, will work with a VB6 ImageList as well as a ComCtl32.dll ImageList.) Typically, the icons for the buttons will be 10x10 bitmaps. The demonstration application contains 8 useful sample buttons. Using the Scroll BarThe scroll bar has a very similar interface to the VB scroll bar control, so you can configure the scroll bar Min, Max, Value and LargeChange properties and so on. The same events (Scroll and Change are also raised. The main differences are
Configuring the ImageListTo associate an ImageList, set the ImageList property of the control to either a VB ImageList instance, or to the hIml (also referred to as hImageList) property of a vbAccelerator or ComCtl32.DLL ImageList. Setting the ImageList is optional, however, if you don't specify one then the buttons will appear blank. Configuring ButtonsYou can add and modify the properties of any buttons you want to associate with the control. Buttons can be either push buttons or check buttons, and check buttons can be grouped so they work as options.
Responding to Button EventsWhen a button is clicked, the control raises a ButtonClick event, passing the 1-based index of the button. Making the ScrollBars XP StyleIf you want the ScrollBars to appear using XP Visual Styles, you need to include a Manifest with your application. Refer to the article Adding XP Visual Styles. The demonstration project includes a Manifest to achieve this.
|
|
|