Command buttons

Command buttons are very common in Windows applications themselves, you will have trouble finding one that doesn't have some. Command buttons work simple, you click, they do, but of course not without some codes which we will be getting into soon...

command buttons preview

Command button properties:

Cancel Determines if the command button runs its click event code if the user presses the Esc key
Caption The caption determines what the button will say on it (this goes for almost all controls)
Default Determines if the button will do something if enter is pressed, even if another control has focus
Enabled Determines if the button is useable or not
Font The controls font
Picture Determines if the button has a pic in it
Style Determines if the button is standard or not, it's best that you always put it as "Graphical"
TabIndex What order the button gets focus by pressing the tab key
TabStop Determines if the button gets focused on w/ the tab button
ToolTipText Determines the text that will be the tooltip (it shows only in runtime mode)
Visible Determines if the control is visible at runtime or not

Tip: The Focus is what control is currently being used, or the one that's currently selected. Add multiple controls to your project, spread them out on the form, run your project and then on the keyboard press tab and then you will see what the focus is.

Tip: The ToolTipText is just a few words you tip the user with. To give you an example, in your project add a Command button, go to its properties and then where it says "ToolTipText" write "Hi." Now run your project and put the mouse pointer over the Command button...

You now know a little bit more about Command buttons then you knew a few minutes ago, interesting isn't it?


Controls                                   Labels