我目前正在創建一盤棋一個給我節省了大量的if
聲明我不知道是否有插入變量如x
到下面的標籤的方式:傳遞一個變量到一個標籤VB
Label1.Text = "MyRedPawns()"
我希望它去()
類似於將用於Console.Writeline
聲明。
編輯:
下面是代碼:
For x = 1 To 4
If mouseclicklocation.X >= MyRedPawns(x).getposition.X And mouseclicklocation.X <= MyRedPawns(x).getposition.X + 80 Then
If mouseclicklocation.Y >= MyRedPawns(x).getposition.Y And mouseclicklocation.Y <= MyRedPawns(x).getposition.Y + 80 Then
Label1.Text = "MyRedPawns()"
Piecefound = True
End If
End If
Next x
我想這是在for循環中被傳遞到label1.text
的()
這根本不清楚。什麼樣的變量是'x',你期望結果如何? –