我正在製作一個非常簡單的遊戲應用程序。主窗體(Form1)上有一個Button1按鈕。 (非常有創意的命名,呃?)應用程序的重點是在整個表單中隨意移動按鈕。我的問題是,當我開始調試時(我使用的是Visual Studio 2010),表單從不顯示,當我打開Windows任務管理器時,我的.exe的名稱從不顯示在進程列表中。我想知道我使用的代碼是否與此有關。這裏是我的代碼:VB.NET中的Windows窗體問題
Class Form1
Private Sub Form1_Load(...)
InitializeComponent()
While True
MoveIt()
End While
End Sub
Sub MoveIt()
Dim rand As Short
Randomize()
rand = (Rnd() * 5)
Select Case rand
Case 0
'move button up 5px
Button1.Top -= 5
Case 1
'move button up 5px
Button1.Top -= 5
Case 2
'move button left 5px
Button1.Left -= 5
Case 3
'move button right 5px
Button1.Left += 5
Case 4
'move button down 5px
Button1.Top += 5
Case 5
'move button down 5px
Button1.Top += 5
End Select
End Sub
End Class
錯了;錯誤。這不會編譯。 – SLaks 2011-02-18 03:28:09