VB Program Example (ii)

Source: Internet
Author: User

3. To adjust the position of the locked control:
Hold down the CTRL key and use the appropriate arrow keys to "fine-tune" the position of the control that has been focused.
Or
You can also change the top and left properties of a control in the Properties window.
"Hello, world!" has now been generated The interface of the application, as shown in Figure 2.4.

Setting properties
The next step is to set the properties for the created object. The Properties window (Figure 2.5) gives an easy way to set all the properties of a Form object. You can open the Properties window by selecting the Properties Window command on the View menu, clicking the Properties Window button on the toolbar, or using the control's context menu.

The Properties window contains the following elements:
1. Object frame--Displays the name of the object that can set the property. Click the arrow to the right of the object frame to display a list of objects for the current form.
2. Sort-Select from an alphabetical list of attributes, or from a hierarchical view of the category page by logic, such as the appearance, font, or position.
3. List of properties--the left column shows all the properties of the selected object, and the right column can edit and view the settings value.
To set properties in the Properties window, follow these steps:
1. From the View menu, choose Properties, or click the Properties button in the toolbar. Properties window displays the value of the property settings for the selected form or control.
2. From the list of properties, select the property name.
3. Enter or select a new property setting value in the right column.
The enumerated attributes have a predefined list of set values. Click the down arrow to the right of the settings box to display the list, or double-click the list item to loop through the list.
Take "Hello, world!," for example, to change the set values of three properties, while others take the default values.

Set Icon Property
In Visual Basic, all forms have a common default icon that appears when the form is minimized. Maybe you want to change an icon that describes the specific purpose of the form or application. Set the Icon property of a form to specify a new icon for the form. x 32 pixel icon MicrosoftWindows's 16-bit version of the standard can also be applied in Winndows 95 and Windows NT, and another x 16 pixel icon is used in Windows 95.

Writing code
The Code Editor window is where you write your application's Visual Basic code. The code consists of statements, constants, and declaration parts. You can quickly view and edit any part of your application's code by using the Code Editor window.
To open a code window:
Double-click the form or control you want to write code for.
Or
From the Project Manager window, select the name of the form or module, and then select the View Code button.
Figure 2.6 Shows the Code Editor window that appears after double-clicking a command button control and the event for that command.
You can display all of the procedures in the same Code window, or you can display only one procedure.
To display all of the procedures in the same Code window, follow these steps:
1. On the Tools menu, select the Options dialog box.
2. In the Options dialog box, on the Editor tab, select the check box to the left of default full mode view. In the check box to the left of procedure separator, you can add or remove separator lines between procedures.
Or
Click the Full Module View button in the lower-left corner of the Code Editor window.

To have the code window display only one procedure at a time, follow these steps:
1. Under the Tools menu, select the Options dialog box.
2. In the Options dialog box, on the Editor tab, clear the check box to the left of default full mode view.
Or
Click the Procedure View button in the lower-left corner of the Code Editor window.
The Code window contains the following elements:
1. Object list box--Displays the name of the selected object. Click the arrow to the right of the list box to display a list of all objects that are off the form.
2. Procedure list Box--Lists the process or event of an object. This box displays the name of the selected procedure. In the present case, the Click event. Select the arrow to the right of the box to display all the events for that object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.