我有这个form
我有这个code
'For Tab Schedule
Dim Schedule_Tab = frmSettings.Tab_Schedule.Controls 'the tab page for schedule
Dim Panel_Set_Num As String
Dim Set_Num As String = "00"
Public Function Schedule_Get() As String
For Each Ctrl_Panel_Set As Control In Schedule_Tab
If TypeOf Ctrl_Panel_Set Is Panel And Ctrl_Panel_Set.Name.StartsWith("Panel_Set_") Then
For Each Ctrl_Lbl_Temp In Ctrl_Panel_Set.Controls
If TypeOf Ctrl_Lbl_Temp Is Label Then
If Ctrl_Lbl_Temp.Name.StartsWith("Lbl_Temp_") Then
If Ctrl_Lbl_Temp.Text = "0" Then
Panel_Set_Num = CType(Ctrl_Panel_Set, Panel).Name
Set_Num = "CSR" & Panel_Set_Num.Substring(Panel_Set_Num.Length - 2) & "^"
Return Set_Num
End If
End If
End If
Next
End If
Next Ctrl_Panel_Set
Return "Done"
End Function
我有这个error
1.没有“As”子句的变量声明;假定的对象类型。
2.警告视为错误:没有“As”子句的变量声明;假定的对象类型。
错误出现在这emphasize
行代码中。
Dim Schedule_Tab = frmSettings.Tab_Schedule.Controls 'the tab page for schedule
我试图按照错误所说的那样去做,但它导致了这种错误。changed
Dim Schedule_Tab
Dim Schedule_Tab As Form.ControlCollection
An unhandled exception of type System.TypeInitializationException' occurred in xxxxxxxxx.exe
Questions:
- 在那种情况下我该怎么办?
- 我应该如何申报
Schedule_Tab
?