这必须是我创造的最可怕的事情,必须有更好的方法去做这件事...... (Sub将值从数字上调和下调限制为25 - 取决于它必须执行按钮点击的值)
Private Sub Activate_Drivers()
Select Case nud_No_Participants.Value
Case 1
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Case 2
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Case 3
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Case 4
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Case 5
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Case 6
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Case 7
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Case 8
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Case 9
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Case 10
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Case 11
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Case 12
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Case 13
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Case 14
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Case 15
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Case 16
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Case 17
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Case 18
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Case 19
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Case 20
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI20.btn_Add_Remove_Driver.PerformClick()
Case 21
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI20.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI21.btn_Add_Remove_Driver.PerformClick()
Case 22
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI20.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI21.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI22.btn_Add_Remove_Driver.PerformClick()
Case 23
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI20.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI21.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI22.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI23.btn_Add_Remove_Driver.PerformClick()
Case 24
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI20.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI21.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI22.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI23.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI24.btn_Add_Remove_Driver.PerformClick()
Case 25
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI4.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI5.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI6.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI7.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI8.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI9.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI10.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI11.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI12.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI13.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI14.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI15.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI16.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI17.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI18.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI19.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI20.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI21.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI22.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI23.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI24.btn_Add_Remove_Driver.PerformClick()
Form1.LapTimerGUI25.btn_Add_Remove_Driver.PerformClick()
End Select
End Sub
答案 0 :(得分:3)
首先,我将Activate_Drivers函数放在Form1中,并为nud_No_participants添加参数。我认为你不需要公开所有的LapTimerGUI。
然后我会将计时器放在列表中
Dim lapTimers As New List(Of whatever)
lapTimers.Add(LapTimerGUI1)
lapTimers.Add(LapTimerGUI2)
lapTimers.Add(LapTimerGUI3)
lapTimers.Add(...)
轻松地遍历列表以执行点击。
For index As Integer = 0 To nud_No_Participants.Value-1
lapTimers(index).btn_Add_Remove_Driver.PerformClick()
Next
我必须说..你在做什么看起来很奇怪。也许你必须重新考虑如何做到这一点。
答案 1 :(得分:2)
您可以将它换成几个if语句,因此随着数字的增加逐步应用其他步骤。
我不是VB编码器,所以这是一个伪代码示例:
Form1.LapTimerGUI1.btn_Add_Remove_Driver.PerformClick()
If nud_No_Participants.Value > 1 Then
Form1.LapTimerGUI2.btn_Add_Remove_Driver.PerformClick()
End If
If nud_No_Participants.Value > 2 Then
Form1.LapTimerGUI3.btn_Add_Remove_Driver.PerformClick()
End If