Class 2 Remote InstructionReview of Working with Buttons
EDU 556 Programming for Instruction
Dr. Steve Broskoske
This is an audio PowerCast. Make sure yourvolume is turned up, and press F5 to begin.Click to advance as usual.
Use of Controls
Buttons
Text boxes allow us togather information fromusers. Users can type intothem. We can also outputinformation to users throughthem.
Labels allow us to presentinformation to users. Theyare for output purposes only.
Common Properties of Controls
Name: Provide a name for the control.
Ex: lblQuestion or txtAnswer
Text: Text to be displayed on the control.
Anchor: Select from left, top, right, bottom toallow the control to stretch as desired to fillthe screen if it is resized by the user.
Visible: Allow control to be visible or invisible.
Backcolor: Change background color.
Naming Controls
Show Answer
Answer appears here.
lblQuestion1
btnShowAnswer1
lblAnswer1
Question appears here.
Coding the Appropriate Control
No need to code thecalendar.
Code the two buttons, whichwill affect the calendar.
MonthCalendar1.Visible = True
MonthCalendar1.Visible = False
Coding the Appropriate Control
Show Answer
Answer will appear here.
Question appears here.
This label will just be used topresent info. to user.
This label’s visible propertywill be initially set to false.Users will not see the answerwhen the form opens.
lblShowAnswer1.Visible = True
An Alternative to Making Visible
Show Answer
Answer will appear here afteruser presses button.
Question appears here.
This label’s visible propertywill be initially set to true, butwe will not type anything intothe text property initially. Thebutton will change the textproperty.
lblShowAnswer1.Text = “Put textto appear in label in quotes.”
Same Thing with a Text Box
Show Answer
Answer appears here afteruser presses button.
Question appears here.
txtShowAnswer1.Text = “Put textto appear in label in quotes.”
Clearing Contents of a Text Box
Clear Answer
Question appears here.
The user can type an answerhere for later processing.
This button will be used toclear the text property of thetext box.
txtStudentAnswer1.Text = “”
Navigating to Other Forms
Private Sub btnGoForm2
        Form2.show()
        Me.Visible = False
To add a new form:Press “add new item” button – Windows form.
Next
Remote Assignment
ShowAnswer
Answer.
Question 1.
ShowAnswer
Question 2.
ShowAnswer
Question.
Answer.
Answer.
Reveal answer bychanging visibilityof text box.
Reveal answer bychanging visibilityof label.
Reveal answer bychanging textproperty of label.
Next
Next