Tuesday, May 8, 2012

How to add and remove toolbars in Visual Basic IDE

Toolbars are collections of small iconic buttons that reside in a bar underneath the menu bar. These buttons offer access to the most commonly used functions that you have in the Visual Basic menu structure. Toolbars are useful because rather than have to negotiate menus and submenus to do what you want, you click a specific button in the toolbar to call a specific functionality in the Visual Basic IDE.

ToolTips

ToolTips are little windows that appear when you hold the mouse pointer over a control or toolbar button for a few seconds. Inside these windows is some text that tells you what the control or toolbar button is about.
Toolbars usually reside under the menu and can be grouped into a single bar. Also, you can drag a toolbar onto the IDE's Code and Form windows to have it "float" for more convenient access.

Add or remove a toolbar to or from the IDE
1. Right-click anywhere on the menu bar, or choose Toolbars from the View menu. The toolbar pop-up menu appears .
You select a predefined toolbar type by right-clicking the VB toolbar.
2. Select the type of standard toolbar that you want from the pop-up menu. If a check is to the left of a toolbar type, that toolbar is already visible.

Using the Debug Toolbar

You use the Debug toolbar to test your program and resolve errors that might occur. When you debug a program, you do things such as run the code a line at a time, examine the values of variables, and stop the code at certain critical points or under certain conditions. For an in-depth discussion of debugging, see Chapter 21, "Debugging Your Applications."

Using the Edit Toolbar

You use the Edit toolbar when you're working with code in a Code window. The features of the Edit toolbar are similar to those of the Edit menu. You can Cut and Paste text. You can manipulate the layout of your code and do text selection, searches, and replacement. Also, you can use automatic coding features such as Quick Info.

An interesting VB IDE feature that the Edit toolbar uses is the Complete Word feature (also trademarked by Microsoft as Intelli-sense). This feature automatically completes a keyword for you. For example, if you were to type Ms into a code window and then invoke the Complete Word feature, Visual Basic would complete the word as MsgBox, an intrinsic Visual Basic function that displays a Windows message box. The Complete Word feature is very useful for avoiding syntax errors due to misspelling. For more information about the specifics of debugging, see Chapter 21.
The Debug toolbar enables you to access the debugging functions of the Visual Basic IDE.
You can access the extended Edit menu and some Debug menu functions from the Edit toolbar.

Using the Form Editor Toolbar

You use the Form Editor toolbar to size, move, and align controls on a form. The Form Editor toolbar has the same set of features as the Format menu.
You align and size multiple controls on a form with the Form Editor toolbar.
Notice the small downward-facing arrowheads to the right of the Align, Center, and Make toolbar buttons. These arrowheads indicate that a drop-down menu will appear when you select that toolbar button.

Working with forms and controls requires that sometimes you have to work with the ZOrder property of a control. ZOrder determines which control has the "right" to supersede the position of another control. Sometimes you might want one control to appear over another--an OptionButton over a PictureBox, for instance. You can accomplish this by dragging the OptionButton over the PictureBox. Alternatively, in code, you can set the value of the OptionButton's ZOrder property to 0. Then, no matter where you place the control at design time, the OptionButton will always be on top. When you place one control over another on a form, you're affecting each control's ZOrder property. The Z order determines the "top most-ness" of a control. Controls with a ZOrder value of 0 are always on top; however, if two controls each have a ZOrder value of 0, they nullify each other.

Using the Standard Toolbar

The standard toolbar is the central toolbar in the Visual Basic IDE. The standard toolbar offers many features found in the File, Project, Debug, and Run menus.
The standard toolbar gives you fast access to often-used functionality and information.

No comments:

Post a Comment