IS437: Spring 2006 Instructor: Dr. Boris Jukic Controls
Learning objectives - Controls: text boxes radio buttons check boxes group boxes picture boxes - Some user-friendly features tab sequence (tabIndex, tabStop properties) focus method access key specification Controls can be enabled and disabled in Design Time
Text Boxes function: accept input from users important properties - Text (string of characters) - MultiLine (boolean: yes/no). I - ScrollBars - PasswordChar (if yes then appears masked) run-time property - SelectedText (text selected by user) e. g., text1.SelectedText methods: cut, copy, paste, clear
RadioButtons function: present mutually exclusive choices Examples male-female freshmen, sophomores, juniors, seniors important properties - Text - Checked (boolean) if a radio button is clicked, its Checked property is set to true, otherwise to false only one radio button in the choice set has its checked property set to true
RadioButtons: example
Check Boxes function: present independent choices Choices that are NOT mutually exclusive Example: product attributes perishable, imported, fragile important properties Text Checked (true or false)
Check Boxes: example If perishableCheckBox.checked = True Then ‘conduct procedures for Perishable Products... EndIf If importedCheckBox.checked = True Then ‘conduct procedures for Imported Products... EndIf If fragileCheckBox.checked = True Then ‘conduct procedures for Fragile Products... EndIf
GroupBox functions: (1) organize controls neatly (2) serve as container object - possible use: limit the scope of a set of radio buttons container objects: forms and groupboxes important properties: - Text
Some user-friendly features focus method tabStop (boolean) and TabIndex properties command buttons - keyboard access keys: for example E&xit - as AcceptButton or CancelButton of the form
Focus method Move the cursor to a particular textbox, e. g, Textbox2.focus
Tab stop & Tab Index
Access keys Alt + X
Accept & Cancel Button Designation AcceptButton and CancelButton are form properties. AcceptButton can be activated by the Enter key. CancelButton can be activated by the Escape key.
Disable controls set the Enabled property of a control to false during design-time during run-time e.g., command1.enabled = false