Foxtable(狐表)用户栏目专家坐堂 → GroupBox 动态控件


  共有2220人关注过本帖树形打印复制链接

主题:GroupBox 动态控件

帅哥哟,离线,有人找我吗?
yifan3429
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2482 积分:22932 威望:0 精华:0 注册:2011/3/29 17:14:00
GroupBox 动态控件  发帖心情 Post By:2024/3/1 20:40:00 [显示全部帖子]

Dim GBox As WinForm.GroupBox
Dim Value As String = "新增明细|新增报价|新增楼层|新增区域"
Dim sps() As Char = {"|"}
Dim Names() As String = Value.Split(sps)
Dim s As Integer = 2
Dim t As Integer = 5
For i As Integer = 0 To Names.length - 1
    If i <> 0 Then
        If i Mod 1 = 0 Then
            s = 2
            t = t + 200.5 '高度换算
        Else
            s = s + 261.5 '宽度换算
        End If
    End If 
    Dim nm As String = Names(i)
    GBox = e.Form.CreateControl(nm, ControlTypeEnum.GroupBox)
    GBox.Theme = "(none)" '去掉原来的样式
    '    zcdd.Font = New Font("宋体", 13, FontStyle.Bold)
    GBox.Text = nm
    GBox.name = nm
    GBox.Width = 261
    GBox.Height = 200
    GBox.BackColor = Color.FromARGB(255, 255, 224)
    GBox.ForeColor = Color.FromARGB(169, 169, 169)
    GBox.Left = s + 8
    GBox.Top = t + 2 
    e.Form.AddControl(GBox) 
Next



Dim zcdd As WinForm.Button
'If dr("窗口按键_菜单") < > Nothing Then
'    Dim Value As String = dr("窗口按键_菜单")
'    Dim sps() As Char = {"|"}
'    Dim Names() As String = Value.Split(sps)
'Dim s As Integer = 2
'Dim t As Integer = 5
For i As Integer = 0 To Names.length - 1
    If i <> 0 Then
        If i Mod 3 = 0 Then
            s = 2
            t = t + 50
        Else
            s = s + 66.5
        End If
    End If
    Dim nm As String = Names(i)
    zcdd = e.Form.CreateControl(nm, ControlTypeEnum.Button)
    zcdd.Theme = "(none)" '去掉原来的样式
    zcdd.Font = New Font("宋体", 9, FontStyle.Bold)
    zcdd.Text = nm
    zcdd.name = nm
    zcdd.Width = 65
    zcdd.Height = 49
    zcdd.Left = s + 8
    zcdd.Top = t + 2 
    zcdd.BorderSize = 0
    zcdd.BackMost = False
    '        Forms("主窗_菜单").Controls("菜单页面").Tabpages("功能操作").AddControl(zcdd)   
    '    e.Form.AddControl(zcdd)
    e.Form.Controls("新增明细").AddControl(zcdd)    不能嵌入控件找不到更多的属性
Next

 回到顶部
帅哥哟,离线,有人找我吗?
yifan3429
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2482 积分:22932 威望:0 精华:0 注册:2011/3/29 17:14:00
  发帖心情 Post By:2024/3/2 13:09:00 [显示全部帖子]

e.Form.panel.parent.parent.Width = 270 '设定窗口的宽度
e.Form.Text = CurrentTable.Name & "_ 菜单"
'Dim CheckBox1 As WinForm.GroupBox
Dim GBox As WinForm.GroupBox
Dim Value As String = "新增明细|新增报价|新增楼层|新增区域"
Dim sps() As Char = {"|"}
Dim Names() As String = Value.Split(sps)
Dim s As Integer = 2
Dim t As Integer = 5
For i As Integer = 0 To Names.length - 1
    If i <> 0 Then
        If i Mod 1 = 0 Then
            s = 2
            t = t + 200.5 '高度换算
        Else
            s = s + 261.5 '宽度换算
        End If
    End If 
    Dim nm As String = Names(i)
    GBox = e.Form.CreateControl(nm, ControlTypeEnum.GroupBox)
    GBox.Theme = "(none)" '去掉原来的样式
    '    zcdd.Font = New Font("宋体", 13, FontStyle.Bold)
    GBox.Text = nm
    GBox.name = nm
    GBox.Width = 261
    GBox.Height = 200
    GBox.BackColor = Color.Transparent '透明背景色  
    GBox.ForeColor = Color.FromARGB(255, 255, 255) 
    GBox.Left = s + 8
    GBox.Top = t + 2 
    e.Form.AddControl(GBox) 
Next



Dim zcdd As WinForm.Button
'If dr("窗口按键_菜单") < > Nothing Then
Dim Value1 As String = "新增明|新增报|新增楼|新增区"
'    Dim sps() As Char = {"|"}
Dim Names1() As String = Value1.Split(sps)
'Dim s As Integer = 2
'Dim t As Integer = 5
For i As Integer = 0 To Names1.length - 1
    If i <> 0 Then
        If i Mod 3 = 0 Then
            s = 2
            t = t + 50
        Else
            s = s + 66.5
        End If
    End If
    Dim nm As String = Names1(i)
    zcdd = e.Form.CreateControl(nm, ControlTypeEnum.Button)
    zcdd.Theme = "(none)" '去掉原来的样式
    zcdd.Font = New Font("宋体", 9, FontStyle.Bold)
    zcdd.Text = nm
    zcdd.name = nm & 1
    zcdd.Width = 65
    zcdd.Height = 49
    zcdd.Left = s + 8
    zcdd.Top = t + 2 
    zcdd.BorderSize = 0
    zcdd.BackMost = False
    '        Forms("主窗_菜单").Controls("菜单页面").Tabpages("功能操作").AddControl(zcdd)   
    '    e.Form.AddControl(zcdd)
    e.Form.Controls("新增明细").AddControl(zcdd) 
Next

改了也是不行

 回到顶部