If args(0)=""
Return False
End If
Dim FormName = Args(0)
Dim txb As WinForm.TextBox
Dim ckb As WinForm.CheckBox
Dim rbt As WinForm.RadioButton
Dim cbx As WinForm.ComboBox
Dim chkcbx As WinForm.CheckedComboBox
Dim dtp As WinForm.DateTimePicker
For Each c As WinForm.Control In Forms(FormName).Controls
If Not c.Enabled Or Not c.ReadOnly
Continue For
End If
If Typeof c Is WinForm.TextBox
txb = c
SaveConfigValue(FormName & "@" & txb,txb.Value)
End If
错误:txb不能转化为String。经查找,TextBox等控件都没有Name属性。如何知道这个控件的名字呢?
另外,SaveConfigValue的保存的值放到哪里了,用户更新软件版本后这个值还存在吗?
If Typeof c Is WinForm.CheckBox
ckb = c
SaveConfigValue(FormName & "@" & ckb,ckb.Value)
End If
If Typeof c Is WinForm.RadioButton
rbt = c
SaveConfigValue(FormName & "@" & rbt,rbt.Value)
End If
If Typeof c Is WinForm.ComboBox
cbx = c
SaveConfigValue(FormName & "@" & cbx,cbx.Value)
End If
If Typeof c Is WinForm.CheckedComboBox
chkcbx = c
SaveConfigValue(FormName & "@" & chkcbx,chkcbx.Value)
End If
If Typeof c Is WinForm.DateTimePicker
dtp = c
SaveConfigValue(FormName & "@" & dtp ,dtp.Value)
End If
Next
Return True