以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 动态控件图标问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=176163) |
-- 作者:yifan3429 -- 发布时间:2022/4/2 9:49:00 -- 动态控件图标问题 Dim lbl12 As WinForm.CheckBox Dim ValueBox As String = "高定|保存|放弃|删除|撤销" Dim spsBox() As Char = {"|"} Dim NamesBox() As String = ValueBox.Split(spsBox) Dim sBox As Integer = e.Form.Width - 2 Dim tBox As Integer = 5 For i As Integer = 0 To NamesBox.length - 1 If i <> 0 Then If i Mod 3 = 0 Then sBox = 2 tBox = tBox + 41.5 Else sBox = sBox + 66.5 End If End If Dim nm As String = NamesBox(i) lbl12 = e.Form.CreateControl(nm, ControlTypeEnum.CheckBox) lbl12.Text = nm lbl12.name = nm lbl12.Width = 50 lbl12.Height = 40 lbl12.Left = e.Form.Width - i * (52) - 52 lbl12.Top = tBox + 2 lbl12.TextAlign = ContentAlignment.BottomCenter \'控件文字位置 lbl12.CheckAlign = ContentAlignment.TopCenter \'控件复选框位置 \'lbl12.BackColor = Color.LightSteelBlue lbl12.Theme = "System" \'控件风格 e.Form.AddControl(lbl12) Next Dim ValueBox As String = "高定|保存|放弃|删除|撤销" 怎么分别给动态控件赋值 ico 图标 [此贴子已经被作者于2022/4/2 9:49:38编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/4/2 10:04:00 -- http://www.foxtable.com/webhelp/topics/0780.htm |
-- 作者:yifan3429 -- 发布时间:2022/4/2 10:13:00 -- 单个的知道怎么搞 就是动态的不会呢 老师 |
-- 作者:有点蓝 -- 发布时间:2022/4/2 10:18:00 -- 这个意思? chk.Image = GetImage(ValueBox (i) & ".Ico")
|