Download presentation
Presentation is loading. Please wait.
1
MsgBox, InputBox, and other Day 7 stuff.
091900
2
MsgBox intMyResponse = MsgBox(“Hey You, Click a button!”, vbYesNoCancel + vbQuestion + vbDefaultButton2)
3
InputBox strAnswer = InputBox(“I’m Bart Simpson, who the are you?”, “Bart’s Frame”, “Homer”, 0, 0) Caption Title Default Answer\ x-position y-position OK to leave some out. Leave commas
4
KeyPress KeyDown KeyUp
Keyboard Events KeyPress KeyDown KeyUp
5
KeyPress UPPERCASE and lowercase letters Numeric digits Punctuation
Enter, Tab, and Backspace
6
Features Autorepeat repeats the event Don’t use it for menu shortcut
Occurs BEFORE a control gets the keystroke.
7
Example - put in txtFields KeyPress event subroutine
KeyAscii = KeyAscii + 1
8
KeyDown More complex and specific Shift, Alt, Control
Example: Make two textboxes that will show the results of your KeyDown event.
9
KeyUp Exact Opposite of KeyDown
10
KeyPreview If the form’s KeyPreview property is TRUE, then
The form can intercept keystrokes before your control gets them.
11
Option Buttons and Check Boxes
Or.. Two Completely New Things Thrown in the Same Chapter
12
Check Boxes vs. Option Buttons
Check Boxes can all be checked Only one Option Button in a group can be checked. Are either TRUE if checked, or FALSE if not.
13
Example of code If (chkMyCheckBox.value = 1) Then statements End If
14
Some Notes Put a frame control on the page to group option buttons.
Put it on FIRST, so it doesn’t “cover” your option buttons.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.