hay
habe mal ne frage im bezug auf diesen code:
ist es möglich mit diesem code eine uhr zu proggen?
Und wenn ja wie geh das?
In diesem code geht der zeiger gegen den uhrzeigersinn...
hoff auf antwort
Habe den Code aus dem Internet: spsforen.com/showthread.php?t=26816
da wird gesagt das der n steuer instrument haben will aber ich wollt ne uhr mit drei zeigern erstellen(wie jede normale uhr halt^^)
habe mal ne frage im bezug auf diesen code:
VB.NET-Quellcode
- Public Class frmZeiger
- Public MiddlePoint As New PointF(150, 150)
- Public MainRadius As Integer = 100
- Public Drehwinkel As Decimal = 0
- Public Value As Single = 0
- Private Direction As Boolean
- Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
- With e.Graphics
- .SmoothingMode = Drawing.Drawing2D.SmoothingMode.HighQuality
- Dim PenBlack As New Pen(Color.Black, 4)
- Dim NeedleEnd As New PointF(MiddlePoint.X - MainRadius * Math.Sin(Drehwinkel), MiddlePoint.Y - MainRadius * Math.Cos(Drehwinkel))
- .DrawLine(PenBlack, MiddlePoint, NeedleEnd)
- End With
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- If Value >= 0 Then
- Direction = True
- ElseIf Value < 0 Then
- Direction = False
- End If
- If Direction = True Then
- Value += 0.5
- ElseIf Direction = False Then
- Value -= 0.5
- End If
- Drehwinkel = (2 * Math.PI) / 1100 * Value
- Invalidate()
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Timer1.Enabled = True
- End Sub
- End Class
ist es möglich mit diesem code eine uhr zu proggen?
Und wenn ja wie geh das?
In diesem code geht der zeiger gegen den uhrzeigersinn...
hoff auf antwort
Habe den Code aus dem Internet: spsforen.com/showthread.php?t=26816
da wird gesagt das der n steuer instrument haben will aber ich wollt ne uhr mit drei zeigern erstellen(wie jede normale uhr halt^^)