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