vb.net涂鸦晋升
Public Class Form1 Dim i As Integer = 0 Dim xleft As Integer Dim j As Integer = 0 Dim xtop As Integer Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load xleft = Button1.Left xtop = Button1.Top End Sub Private Sub Timer1_Tick(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Timer1.Tick If i = 0 Then xleft += 3 If xleft > Me.ClientSize.Width - Button1.Size.Width Then xleft = Me.ClientSize.Width - Button1.Size.Width i = 1 End If Else xleft -= 3 If xleft < 0 Then xleft = 0 i = 0 End If End If If j = 0 Then xtop += 2 If xtop > Me.ClientSize.Height - Button1.Size.Height Then xtop = Me.ClientSize.Height - Button1.Size.Height j = 1 End If Else xtop -= 2 If xtop < 0 Then xtop = 0 j = 0 End If End If Button1.Left = xleft Button1.Top = xtop End Sub End Class
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |