

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. As you learn more about Visual Basic, you will become familiar with the properties you can set only at runtime. 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.


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. You can set some properties only at design time (such as a control's Name property). 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.
#VISUAL BASIC CMD CODE#
In addition, although command button controls support over a dozen events, you'll write code only for the Click event in most cases. Locate and size the command button on the form.Ģ.Ĝhange the command button's Name and Caption properties.ģ.Ědd code to the command button's Click event procedure.Īlthough the command button control supports dozens of properties, you'll set only the Name and Caption properties in most cases. In almost every case, you will perform these tasks to add a command button to an application:ġ. Command buttons determine when the user wants to do something such as exit the application or begin printing.
#VISUAL BASIC CMD WINDOWS#
Command buttons appear in almost every window of every Windows application.
