Computer Science, asked by stu0944, 10 months ago

Describe a visual basic form. Insert a command button with the code to end the execution. Set the caption property of the command button as QUIT

Answers

Answered by aarushiwillows
2

Answer:

1. Locate and size the command button on the form.

2. Change the command button's Name and Caption properties.

3. Add code to the command button's Click event procedure.

Although the command button control supports dozens of properties, you'll set only the Name and Caption properties in most cases. In addition, although command button controls support over a dozen events, you'll write code only for the Click event in most cases. After all, a command button resides on most forms so that the user can click the button to trigger some event that he wants to start.

You can set some properties only at design time (such as a control's Name property). You can set some properties (such as a caption) both at design time and at runtime inside event procedures and other module code, and you can set some properties (such as a list box's entries) only at runtime from within the program. All the control's properties that appear in the Properties window can be set at design time, and some you can set at runtime as well. As you learn more about Visual Basic, you will become familiar with the properties you can set only at runtime.

You will set the command button's Name and Caption properties most of the time, setting the Caption property often requires that you change the font to increase or decrease the text size and style on the caption. Of course, you might want to center the caption text or, perhaps, left-justify or right-justify the text, so you also might need to change the Alignment property. you will also set the Left, Height, Top, and Width properties when you size and locate the command button because," these properties update automatically when you place and size controls.

Property - Description

BackColor - Specifies the command button's background color. Click the BackColor's palette down arrow to see a list of colors, and click System to see a list of common Windows control colors. Before the command button displays the background color, you must change the Style property from 0-Standard to 1-Graphical.

Cancel - Determines whether the command button gets a Click event if the user presses Esc.

Caption - Holds the text that appears on the command button.

Default - Determines if the command button responds to an Enter keypress even if another control has the focus.

Enabled - Determines whether the command button is active. Often, you'll change the Enabled property with code at runtime when a command button is no longer needed and you want to gray out the command button.

Font - Produces a Font dialog box in which you can set the caption's font name, style, and size.

Height - Holds the height of the command button in twips.

Left - Holds the number of twips from the command button's left edge to the Form window's left edge.

MousePointer - Determines the shape of the mouse cursor when the user moves the mouse over the command button.

Picture - Holds the name of an icon graphic image that appears on the command button as long as the Style property is set to 1-Graphical.

Style - Determines whether the command button appears as a standard Windows command button (if set to 0-Standard) or a command button with color and possible picture (if set to 1-Graphical).

TabIndex - Specifies the order of the command button in the focus order.

TabStop - Determines whether the command button can receive the focus.

ToolTipText - Holds the text that appears as a ToolTip at runtime.

Width - Holds the width of the command button in twips

A command button's Cancel property relates somewhat to focus. Whereas the focus determines which control gets the Enter key press, a command button's Cancel property determines which command button gets a simulated Click event when the user presses the Esc key. Often, a command button used to exit an application or close a dialog box has its Cancel property set to True. Therefore, you can close such applications or dialog boxes by clicking the command button or by pressing Esc.

A command button's Default property also relates somewhat to focus. When a form first appears, the command button with the Default property of True receives the Click event when the user presses Enter. Another control might have the focus at that time, but if a command button has a Default property value of True, that button receives a Click event when the user presses Enter—unless the user moves the focus to another command button before pressing Enter. Only one command button can have a Default value of True at any one time. As soon as you assign a command button's Default value to True, either at design time or at runtime, any other command button on the form with a True Default value immediately changes to False. Therefore, Visual Basic protects a form's integrity by ensuring that only one command button can have a True Default value at any one time.

PLEASE MARK ME AS BRAINLIEST

:D

Explanation:

Similar questions