Creating a New Toolbar VB Help

To create a new toolbar, follow these steps:,

1. Choose View> Toolbars > Customize to open the Customize dialog box.
2. Select the Toolbars tab, and click the New button.
3. Enter the name of the new toolbar (in Figure 1.3, it’s MyToolbar).  A small empty toolbar appears on your screen.
4. To add icons to your new toolbar, select the Commands tab, which contains all the commands of the IDE’s,menus organized according to the menu to which they belong.
5. Click the icon you want to add to your custom toolbar, and drag it from the Customize dialog box to your new toolbar,
6. Add as many command icons as necessary, and then close the Customize dialog box.

The Project Explorer

The window titled Project is the Project Explorer,which displays the components of the project. Simple projects, such as the ones we develop in the early chapters of this . book, are made up of a single Form In later chapters, you’ll see projects that have . multiple Forms and other types of components, such as Class Modules and ActiveX
controls.

The project components are organized in folders, and the Project window is called Project Explorer because it has the look of the Windows Explorer. As you will see in later chapters, Visual Basic 6 can manage projects and groups of projects.

The Toolbox

The Toolbox contains the icons of the controls you can place on a Form to create the application’s user interface. By default, the Toolbox contains the pointer icon and the icons of 20 ActiveX controls (explained later in this chapter w the section “The Elements of the User Interface”). To place a control (such as a Command button) on a Form, you first select it with the mouse and then move the mouse over the Form. When the mouse is over the Form, the cursor tums into a cross, and you can draw the control on the Form, just as you would draw a rectangle using a drawing application. The size of the rectangle determines the size of the control.

In addition to the default Toolbox (called General), you can create custom layouts by right-clicking the Toolbox and selecting Add Tab from the shortcut menu. Instead of crowding the Toolbox with all the ActiveX controls you need for a project, you can create several tabs with icons on the Toolbox and organize the controls according to function.

To add a new tab to the Toolbox, follow these steps:

1. Right-click the Toolbox to open the shortcut menu.
2. Choose Add Tab, and enter the name of the new tab. Visual Basic displays a new button (such as the General button) in the Toolbox.
3. Click the new tab button to open the tab, and then right-click it to  display a shortcut menu.
4. Select Components to display a list of all ActiveX controls installed on your system.
5. To add to the current tab, check the checkbox in front of the names of the controls, as shown.

The Properties Window

The Properties window contains the property’ settings for the selected control. Properties are attributes of an object, such as its size, caption, and color. You can adjust the appearance of the controls on the Form. with point-and-dick operations. For example, you can set the string that appears on a Command button by locating the Caption property in the Properties window and typing a new value, such as “Click me!”. To change the color of a Form, locate the BackColor property in the Properties window, and click the arrow button next to the current value of the color ..visual Basic displays a color selection box, as shown. Select a color on this
box to instantly fill the Form with the new color .

The Form Designer

The Perm Designer is the main window in the middle of the screen, and in it you design and edit the application’s user interface. The same window displays a text ed~tor in which you can enter and edit the application’s code. The Form Designer displays two windows for each Form:

• The Form itself (the elements of the visible user interface)
• A Code window'(the code behind the elements of the Form)

To switch between the two views, click the little icons (View Code and View Form) at the top of the Project Explorer Select the Form, you want to view in the Project Explorer, and then click one of the two View buttons to see the Form or its code.

The Form Layout

You use the Form Layout window, which is in the lower-right comer of the Visual Basic IDE, to determine the initial positions of the Forms in your application. You can move Forms around and place them on top of each other. This window is useful in applications that use multiple-Perms because you can specify how each Form is positioned with respect to the main Form.It shows the placement of three Forms on the Desktop and their initial relative positions. The insert in the lower-right corner shows how the placement of the Forms was specified in the Form Layout window,

Posted on November 4, 2015 in Getting Started with Visual Basic

Share the Story

Back to Top
Share This