Public Function Position1 (button, blabla)
button.location = New Point(3,9)
Return blabla
End Function
Public Function Position2 (button, blabla)
button.location = New Point(3,50)
Return blabla
End Function
Public Function Position3 (button, blabla)
button.location = New Point(3,91)
Return blabla
End Function
依此类推,直到功能位置100
我想调用这些函数并使代码更简单,使用循环" For .... Next"
所以请告诉我修复此代码:
Private Sub Button1_Click and so on....
For x = 1 to 100
positionx(button1,"filled")
Next
End Sub
答案 0 :(得分:0)
将点坐标作为参数添加到一个单独的函数中,并有一个要迭代的点列表..