Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

VB .NET - Learn Visual Basic .NET

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 4

Button Object and Buttons Collection of ToolBar Control in Visual Basic 6

Command buttons on a toolbar are called Button objects, and all the Button objects are stored in the Buttons Collection. This is similar to the way that the TreeView Node objects are contained in a Nodes Collection. Each Button object has many properties that control its appearance and functionality. These properties can be set either at design time through the Buttons tab of the Property Pages dialog box (see Figure 4.10) or at runtime.

Buttons tab of the Custom Properties of a toolbar.
FIGURE 4.10 Buttons tab of the Custom Properties of a toolbar.

As with the other controls discussed in this chapter, individual Button objects can be referenced by either the Index property or the Key property. The Index property has an integer value that refers to a button's position on a toolbar. The first button on a toolbar will have an index value of 1. The Key property is a unique string expression that can be used to access a particular button on a control.

NOTE: Key Property of a Toolbar's Button Object The Key property of a Button object cannot contain a numeric expression even if you convert the number using the Str$() function first. If you try to use a number converted to a string as the key to a Button object, you will receive a runtime error indicating an invalid key value.

ToolBar Control topics

See Also


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved