Horloge analogique vb
Résolu
easy-life
Messages postés
38
Date d'inscription
Statut
Membre
Dernière intervention
-
zouhair -
zouhair -
A voir également:
- Horloge analogique vb
- Vb - Télécharger - Langages
- Horloge mondiale gratuite - Télécharger - Outils professionnels
- Appli horloge - Télécharger - Guide Android
- Horloge en ligne aesthetic - Télécharger - Thèmes & Fonds d'écran
- Vb cable - Télécharger - Audio & Musique
9 réponses
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
je l 'ai fait mais j ai pas trouvé ...et d'ailleurs les forums sont fait pour cette raison alors ne te vante pas trop stp ...je retire mon merci !!
Non, le forum n'est pas fait pour que les autres cherchent sur google à ta place. Parce que la réponse, tu l'avais obtenue toi aussi, mais il fallait prendre le temps de trier un peu... trop fatiguant, sans doute.
Et pourquoi dis-tu à mat de ne pas se vanter, il ne l'a pas fait ? Il t'avait répondu très poliment et toi tu te comportes comme un c***
Et pourquoi dis-tu à mat de ne pas se vanter, il ne l'a pas fait ? Il t'avait répondu très poliment et toi tu te comportes comme un c***
je veux pas faire un duel avec toi mais qui t'as adressé la parole dejà???
j'ai pas besoin de tes remarques et saches que c'est toi le c***....toi et ton Matt
chlakh!!
j'ai pas besoin de tes remarques et saches que c'est toi le c***....toi et ton Matt
chlakh!!
utiliser timer et voiser
le code voutr ami zouhair ifni-best du maroc
..................
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Private PenHour, PenMinute, PenSecond As Pen
Private g As Graphics
Private Bg As BufferedGraphics
Private MidX, MidY As Single
Private Rect As Rectangle
Private Sub InitializeVariables()
Rect = PicHorloge.ClientRectangle
MidX = PicHorloge.Width / 2 : MidY = PicHorloge.Height / 2
PenHour = New Pen(Brushes.Tomato, 5)
PenMinute = New Pen(Brushes.LightGoldenrodYellow, 3)
PenSecond = New Pen(Brushes.YellowGreen, 2)
End Sub
Private Sub DrawNumbers()
Static X, Y As Single
For i As Integer = 1 To 12
X = Math.Sin((i * Math.PI) / 6) * MidX + MidX
Y = -Math.Cos((i * Math.PI) / 6) * MidY + MidY
g.DrawLine(Pens.Transparent, New PointF(MidX, MidY), New Point(X, Y))
Next
Dim wrect1 As Integer = Rect.Width - 10
Dim prect1 As New PointF(5, 5)
Dim rect1 As New RectangleF(prect1, New SizeF(wrect1, wrect1))
End Sub
Private Sub PicHorloge_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicHorloge.Paint
Bg = BufferedGraphicsManager.Current.Allocate(e.Graphics, Rect)
g = Bg.Graphics
g.Clear(Color.Transparent)
DrawHour() : DrawMinute() : DrawSecond()
Bg.Render()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
InitializeVariables()
End Sub
Private Sub DrawHour()
Dim h As Single = Now.Hour + (Now.Minute / 60)
Static X, Y As Single
X = Math.Sin((h * Math.PI) / 6) * 90 + MidX
Y = -Math.Cos((h * Math.PI) / 6) * 90 + MidY
g.DrawLine(PenHour, New PointF(MidX, MidY), New Point(X, Y))
End Sub
Private Sub DrawSecond()
Dim s As Integer = Now.Second
Static X, Y As Single
X = Math.Sin((s * Math.PI) / 30) * 120 + MidX
Y = -Math.Cos((s * Math.PI) / 30) * 120 + MidY
g.DrawLine(PenSecond, New PointF(MidX, MidY), New Point(X, Y))
End Sub
Private Sub DrawMinute()
Dim M As Integer = Now.Minute
Static X, Y As Single
X = Math.Sin((M * Math.PI) / 30) * 100 + MidX
Y = -Math.Cos((M * Math.PI) / 30) * 100 + MidY
g.DrawLine(PenMinute, New PointF(MidX, MidY), New Point(X, Y))
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PicHorloge.Refresh()
End Sub
End Class
le code voutr ami zouhair ifni-best du maroc
..................
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Private PenHour, PenMinute, PenSecond As Pen
Private g As Graphics
Private Bg As BufferedGraphics
Private MidX, MidY As Single
Private Rect As Rectangle
Private Sub InitializeVariables()
Rect = PicHorloge.ClientRectangle
MidX = PicHorloge.Width / 2 : MidY = PicHorloge.Height / 2
PenHour = New Pen(Brushes.Tomato, 5)
PenMinute = New Pen(Brushes.LightGoldenrodYellow, 3)
PenSecond = New Pen(Brushes.YellowGreen, 2)
End Sub
Private Sub DrawNumbers()
Static X, Y As Single
For i As Integer = 1 To 12
X = Math.Sin((i * Math.PI) / 6) * MidX + MidX
Y = -Math.Cos((i * Math.PI) / 6) * MidY + MidY
g.DrawLine(Pens.Transparent, New PointF(MidX, MidY), New Point(X, Y))
Next
Dim wrect1 As Integer = Rect.Width - 10
Dim prect1 As New PointF(5, 5)
Dim rect1 As New RectangleF(prect1, New SizeF(wrect1, wrect1))
End Sub
Private Sub PicHorloge_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicHorloge.Paint
Bg = BufferedGraphicsManager.Current.Allocate(e.Graphics, Rect)
g = Bg.Graphics
g.Clear(Color.Transparent)
DrawHour() : DrawMinute() : DrawSecond()
Bg.Render()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
InitializeVariables()
End Sub
Private Sub DrawHour()
Dim h As Single = Now.Hour + (Now.Minute / 60)
Static X, Y As Single
X = Math.Sin((h * Math.PI) / 6) * 90 + MidX
Y = -Math.Cos((h * Math.PI) / 6) * 90 + MidY
g.DrawLine(PenHour, New PointF(MidX, MidY), New Point(X, Y))
End Sub
Private Sub DrawSecond()
Dim s As Integer = Now.Second
Static X, Y As Single
X = Math.Sin((s * Math.PI) / 30) * 120 + MidX
Y = -Math.Cos((s * Math.PI) / 30) * 120 + MidY
g.DrawLine(PenSecond, New PointF(MidX, MidY), New Point(X, Y))
End Sub
Private Sub DrawMinute()
Dim M As Integer = Now.Minute
Static X, Y As Single
X = Math.Sin((M * Math.PI) / 30) * 100 + MidX
Y = -Math.Cos((M * Math.PI) / 30) * 100 + MidY
g.DrawLine(PenMinute, New PointF(MidX, MidY), New Point(X, Y))
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PicHorloge.Refresh()
End Sub
End Class