各位狐兄,大家好,请抽空指教
1.窗口中代码生成的多个单选框,不知如何设置字体等样式;
'以下代码在登录时生成合同名称标签供单选使用
Dim ss() As String
Dim Filter2 As String
With e.Form.Controls("UserName")
Dim name As String = DataTables("工程信息").GetComboListString("合同名称","[授权用户] like '*"&.Value &"*'")
Dim i As Integer = 0
ss = name.Split("|")
For Each s As String In ss
Dim sb As WinForm.RadioButton
Dim t As Integer
sb = e.Form.CreateControl(s,ControlTypeEnum.RadioButton)
sb.Text = s '设置单选框的文字内容
sb.Appearance = Appearance.Normal '设置单选框的外观样式为标准Normal,按钮样式为Button
'以下设置单选框字体
Dim fnt As New Font(sb.Font.name,10, sb.Font.Style)
sb.Font = fnt
'以上设置单选框字体
sb.Left = 80 '设置单选框的左边边距为80像素
sb.Width = 400 '设置单选框宽度为330像素
sb.Top = i*20 '设置垂直边距为20像素
i = i + 1
e.Form.AddControl(sb)
Next
End With
'以上代码在登录时生成合同名称标签供单选使用
2.想通过按钮删除同一类型(单选框)的控件,遍历控件后不知如何删除
For Each c As WinForm.Control In e.Form.Controls
If Typeof c Is WinForm.RadioButton Then
End If
Next
此主题相关图片如下:删除单选框.png
[此贴子已经被作者于2012-3-26 22:18:52编辑过]