Back To Introduction
Tutorial 4 Slider Control
Variables GOAL: Experience
event-driven application with a Timer and Mouse events PREREQUISITES: Tutorial
3 Add a Timer A.
Name
to “Timer_Echo” B.
Text
to “0” C.
BorderStyle
to “Fixed3D D.
AutoSize
to “False” A.
Enabled
to “true” B.
Interval
to “1000” 4.
Create a Service Routine, again to service the Timer events A. Go to Events
double-click on blank space to the right of Tick 5 Before
putting code into the Timer function block, go into Form1.Designer.cs Add
in another private int variable, I called it counter. 6. Initialize
counter to “0” inside Form1.cs 7. Now
inside the function code block for timer1_Tick(...),
add the following code: Create Mouse Echo
Text A.
Name to
“Mouse_Echo” B.
Text
to “” C.
BorderStyle
to “Fixed3D” D.
AutoSize
to “False” Mouse Button Events
(Left and Right) A.
Go to the Mouse
Events B.
Double-Click on the blank space to the right of MouseDown 3.
Now inside the function code block for Form1_MouseDown(...), add the following Mouse Move Event A. Go to the Mouse Events B. Double-Click on the blank space
to the right of MouseMove 3. Now
inside the function code block for Form1_MouseMove(...),
add the following §
In the Visual Studio project window, click