Option Strict On Public Class Form1 Private Sub cosS( _ ByVal g As Graphics, ByVal nagasa As Integer, ByVal kakudo As Integer, ByVal iro As Pen) Dim x As Integer = CInt(nagasa * Math.Cos(kakudo * Math.PI / 180)) Dim y As Integer = CInt(nagasa * Math.Sin(kakudo * Math.PI / 180)) g.DrawLine(iro, 150, 150, 150 + x, 150 + y) End Sub Private Sub PictureBox1_Paint( _ ByVal sender As Object, ByVal e As PaintEventArgs) Handles PictureBox1.Paint Dim i As Integer = 270 Dim hari As Integer '針 hari = Now.Second * 6 + i cosS(e.Graphics, 100, hari, Pens.Black) hari = Now.Minute * 6 + i cosS(e.Graphics, 80, hari, Pens.Aqua) Dim ji As Integer = Now.Hour hari = (ji * 30 + i) + ji \ 2 cosS(e.Graphics, 50, hari, Pens.Red) End Sub Private Sub Timer1_Tick( _ ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick PictureBox1.Invalidate() '描画して欲しい、と PictureBox にお願いするためのメソッド End Sub Private Sub Form1_Load( _ ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Timer1.Interval = 300 Timer1.Start() End Sub End Class