Learn the most popular programming language of the most popular Operating System: Windows

Ad

Disabling the Minimize Button

With the first two border styles, the Minimize button appears unless it is disabled by the Minbutton property to change the setting to False.  (With this property, there are only two choices: True and False.)

Disabling the Maximize Button

With the first two borderstyles, the Maximize button appears, unless it is disabled.  To disable the button, double-click the MaxButton property to change the setting to False. (Like MinButton, only two choices are available with MaxButton: True and False.)

Disabling the Control Box

With the first three border styles, the control box appears unless it is disabled.  To disable the box, double-click the ControlBox property to change the setting to False. (The two settings for ControlBox are True and False.)

Changing the Window State

The WindowState property determines the appearance of the form at runtime.  Table 2.3 shows its three settings.

Table 2.3 The Settings for the WindowState Property
ValueSettingDescription
0 Normal The form appears in normal size (the default).
1 Minimized The form is minimized and appears as an icon (either on the taskbar or above it) when the application is run.
2 Maximized The form is maximized and expands to fit the entire screen when the application is run.

Changing the background Color

Part of the enjoyment of working with Visual Basic is the ease with which colors can be added to a form.  Color settings are expressed in hexadecimal notation (base 16). The designers of Visual Basic did not expect you to work with hexadecimal numbers and instead provided a color palette.  To open the palette, double-click the Backcolor setting and click Palette.  When the Color palette appears, click a color to change the background color of the form.  Following the click, the hexadecimal number assigned to the color appears in the text box.

Changing Font Properties

When working with text, Visual Basic enables you to change the font (or text style) you are working with.  To determine which fonts are available on your system, open the Properties window, highlight Font, and click the ellipsis button to the right.  A dialog box appears for setting numerous font properties, including Name, Bold, Italic, Size, StrikeThrough, and Underline.

Changing the Foreground Color

The ForeColor property determines the color of the text and graphics to be displayed.  This differs from Backcolor, which determines the background color of the object.  To set this property, double-click ForeColor and click Palette.  Make the color selection using the palette.

Changing the Startup Position

The StartUpPosition property specifies the position of the form when it first appears.  Table 2.4 shows its four settings.

Table 2.4 The Settings of the StartUpPosition Property
ConstantValueDescription
vbStartUpManual0No initial setting specified
vbStartUpOwner1 Center on the item to which the UserForm belongs.
vbStartUpScreen 2Center on the whole screen.
vbStartUpWindows3Position in upper-left corner of screen.
Share:

Trending

Popular Posts

Search This Blog

Powered by Blogger.

Featured Post

Coded Statements and Methods

In the preceding procedure , you wrote several coded instructions, which introduced two different programming statements and a method: the D...

Recent Posts