VB.net 能让button控件在窗体中做圆周运动吗
1个回答
展开全部
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim x, y As Integer Dim i As Double For i = 0 To 6 Step 0.0005 x = 220 + 100 * Math.Cos(i) Me.PictureBox2.Left = x y = 120 + 100 * Math.Sin(i) Me.PictureBox2.Top = y Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Enabled = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Enabled = True End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询