110 likes | 203 Views
Class 2 Remote Instruction Review of Working with Buttons. EDU 556 Programming for Instruction Dr. Steve Broskoske. This is an audio PowerCast . Make sure your volume is turned up, and press F5 to begin. Click to advance as usual. Use of Controls.
E N D
Class 2 Remote InstructionReview of Working with Buttons EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume is turned up, and press F5 to begin. Click to advance as usual.
Use of Controls Text boxes allow us to gather information from users. Users can type into them. We can also output information to users through them. Buttons Labels allow us to present information to users. They are 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 to allow the control to stretch as desired to fill the screenif it is resized by the user. • Visible: Allow control to be visible or invisible. • Backcolor: Change background color.
Naming Controls lblQuestion1 Question appears here. btnShowAnswer1 Show Answer Answer appears here. lblAnswer1
Coding the Appropriate Control No need to code the calendar. Code the two buttons, which will affect the calendar. MonthCalendar1.Visible = True MonthCalendar1.Visible = False
Coding the Appropriate Control Question appears here. This label will just be used to present info. to user. lblShowAnswer1.Visible = True Show Answer Answer will appear here. This label’s visible property will be initially set to false. Users will not see the answer when the form opens.
An Alternative to Making Visible Question appears here. lblShowAnswer1.Text = “Put text to appear in label in quotes.” Show Answer This label’s visible property will be initially set to true, but we will not type anything into the text property initially. The button will change the text property. Answer will appear here afteruser presses button.
Same Thing with a Text Box Question appears here. Show Answer txtShowAnswer1.Text = “Put text to appear in label in quotes.” Answer appears here afteruser presses button.
Clearing Contents of a Text Box Question appears here. The user can type an answer here for later processing. This button will be used to clear the text property of the text box. Clear Answer txtStudentAnswer1.Text = “”
Navigating to Other Forms To add a new form:Press “add new item” button – Windows form. Private Sub btnGoForm2 Form2.show() Me.Visible = False Next
Remote Assignment Question 1. Question 2. Question. ShowAnswer ShowAnswer ShowAnswer Answer. Answer. Answer. Next Next Reveal answer by changing visibility of text box. Reveal answer by changing visibility of label. Reveal answer by changing text property of label.