Title: Chapter 2 Key Terms
1Chapter 2 Key Terms
2AcceptButton Property
A form property
- Allows the use of Enter key to work in tandem
with a button. - Avoids mouse manipulation.
The Buttons on the form
3access key
- Applies to Buttons
- Ampersand () to the right of a text letter
enables key stroke to replace mouse click.
Note the ampersand
Note the underline
does not have to be the first letter of text
4BorderStyle Property
- Frames certain visible objects such as the Label,
TextBox, and PictureBox. - Outlines otherwise invisible empty Labels.
5CancelButton Property
- Allows the use of Esc key to work in tandem with
a button. - Avoids mouse manipulation.
A form property
The Buttons on the form
6CheckBox
Text property
- User may select an option.
- CheckedChanged event procedure
- Checked and CheckState properties
- May have two or three states
- User may check any number of checkboxes
7Checked Property of the CheckBox
- False if CheckBox is unchecked, True if checked.
8Color constants
- Color class contains many colors.
9Component Tray
- Holds controls that have no visual at run time.
Appears in the document window below the design
form.
10Concatonation
- Joining strings of text.
- Ampersand operator ()
- Example
- passwordTextBox.text " is not valid."
space
11empty string
- Quotation mark set with no characters between.
("") - Example
- nameLabel.Text ""
- Example results in empty Label.
- May be used instead of the Clear method.
- nameLabel.Clear( )
12Focus
- Buttons with the focus may be activated with the
Enter key. - TextBoxes with the focus contain an insertion
point cursor. - Focus may be shifted to another control by
tabbing or by code. - Applies only to certain controls
- Focus changes are actionable events.
13Focus Method
- Grabs the focus from another control
- Example code
- phoneNumberTextBox.Focus( )
- Example shifts the focus to the TextBox.
- Often used when a form is cleared to place the
insertion cursor in the TextBox needed
immediately by the user.
14ForeColor Property
- The color of text.
- Example
- warningLabel.ForeColor Color.Red
- Example causes the text in the label to be
colored red.
15GroupBox
- Controls placed in a GroupBox can be moved as a
group at design time or at run time. Within the
group, relative position is preserved. - RadioButtons placed in a GroupBox function
cooperatively.
16Image Property
- Applies to controls that can hold images.
Click on ellipse to browse for images
17Line Continuation Character
- space followed by underscore
- use it to break long lines of code
- will not break words or identifiers
18PictureBox Control
- Specifically for holding an image.
- For portability, the image file should be copied
into the .bin folder of the project. - See the previous slide titled Image Property
19RadioButton
- Use when user may select only one of many.
- Place cooperative RadioButtons in a GroupBox.
- CheckedChange is an actionable event
- Initial state of Checked Property may be set at
design time.
20Select Resource Dialog Box
- In Visual Studio 2005, the ellipse in Image
Property box opens the Select Resource Dialog
box. - In Visual Studio 2003, the ellipse in Image
Property box opens an Open Dialog box.
21Size Mode Property
- Applies to images.
- StretchImage makes image fill the PictureBox.
Size Modes
22StartPosition Property of Form
- Upper left is default position of the form at run
time.
Start Position choices
23Tab Index Property
- Allows user to use Tab key to move focus in a
predetermined order. - After controls are in place, use ViewgtTab Order
to set the order. - Set TabStop to False to remove a control from the
Tab order. - Applies only to controls that can recieve the
Focus - Tab order must be turned off.
Change TabOrder by clicking on the control
24TextBox
- For typed user input.
- The initial value of the text property may be set
at design time - The text property may be changed by code at run
time. - When in Focus it holds the insertion cursor
- Entering user text is an actionable event.
25TextAlign Property
- Applies to controls that hold text
- Justifies the text.
26ToolTip
- Appears when mouse hovers on control.
- Provides terse explanation to the user.
Double click on icon in ToolBox to place icon
into component tray. Then edit the ToolTip
property for each control.
27Visible Property
- Controls visibility of a control.
- Set to False to hide a control.
- Set to True to show a control.
- May be changed at design time or at run time.
28With and End With (With block)
- Use in code when several properties of the same
object are to be changed at the same time. May
also include methods. - Saves typing. Example