-- 作者:owenlyx
-- 发布时间:2014/1/3 10:05:00
-- 控件赋值问题
思路是判断控件类型,然后将表中按钮图标图案自动赋予按钮控件,代码如下:
For Each a As WinForm.Control In e.Form.Controls If typeof a Is winform.button Then Dim t As WinForm.Button = a Dim dr As DataRow = DataTables("配置表").Find("[窗口名称] = \'" & e.Form.Name & "\'and [按钮名称] = \'" & t.name & "\'" ) If dr IsNot Nothing Then t.text = dr("按钮标题") t.Image =dr("按钮图标") End If End If Next
报错如下:
此主题相关图片如下:截图11.jpg
请指教,谢谢
|