|
|
|
|
|
The Microsoft
Visual C# .Net member of the Microsoft Visual Studio .Net |
|
Analogue_Clock_VCSNet
application ..., describe how to use Microsoft
Visual C# .Net to draw Analogue
Clock
The Classes used ... System Drawing, Timer, PictureBox, Label,
Button
- Name -
Analogue_Clock_VCSNet.
-
Graphic
Software.
- Developed with
Microsoft Visual C# .Net.
-
Functions ...
-
Array of 60 point object used to draw the analogue clock.
The struct ClockTab declare this array
public
struct
ClockTab
{
public
double[]
cospi;
public
double[]
sinpi;
}
- Analogue and
digital clocks display.
|
- Requirements:
Microsoft Visual Studio .Net.
If you want
to run it:
- Remove the
read-only attribute of all files in the
folder - C:\Analogue_Clock_VCSNet
- Run the
Microsoft Visual Studio .Net.
- From
File menu, choose Open,
choose Project
..., the Open Project
dialog box appears, select the project file
Analogue_Clock_VCSNet.csproj
- (C:\Analogue_Clock_VCSNet\Analogue_Clock_VCSNet..csproj)
and then click Open.
- From
Debug menu, choose and click
Start.
|
Project - Analogue_Clock_VCSNet
and those items
|
Create Project -
Analogue_Clock_VCSNet Run Microsoft
Visual Studio .Net. On the File menu , click New,
and then click Project .... The New Project dialog box
appears.
- In the Project
Types pane, select the Visual C# Projects
folder.
- In the Templates
pane, select Windows Application icon (project type). A
message appears indicating the type of project you are going to
create - (A project for creating an application with a Windows
user interface).
- In the Name
box, type
Analogue_Clock_VCSNet.
- In the
Location box, type C:\
- Click OK.
The
Windows Application create all necessary files and opens the
Microsoft Visual Basic .Net project - Analogue_Clock_VCSNet
|
|
Rename the Form created ...
- On the View
menu , click Solution Explorer
- In Solution
Explorer, expand the Analogue_Clock_VCSNet project node
and select Form1.cs
- In Properties
windows, Type the new File Name
|
Old |
New |
Filename : |
Form1.cs |
AnalogueForm.cs |
|
|
|
After running,
you can observe the
design
..
|
 |
|
|
|
The View design ..
List of controls added
from the
Toolbox/Windows Form:
one
PictureBox
control, four Label controls, two
Button controls and two Timer controls.
The Functions ...
How this software paint
the Analogue
clock ...
- Procedure
PaintClock
paint 60
point objects. ( Circle of Points)
- Procedures DrawMHHand
and DrawSecondHand draw
the 3 hands of clock
- Timer
control. used to move the hands (change the position)
|
Click the Button About, the Form About.cs
displays.
Click the Button Done, the current Form unload
The Codes ...
|
| |
Click the Button About, new design
with animation display.
|
|
|
List of controls
added
from
the
Toolbox/Windows Form:
Tree
PictureBox
control, seven Label controls, one Button
control and one Timer control.
Click the Button Done, the
current Form unload |
| |
|
|