Foxtable(狐表)用户栏目专家坐堂 → [求助]用代码实现的SplitContainer中,其他控件为什么看不见


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

主题:[求助]用代码实现的SplitContainer中,其他控件为什么看不见

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/20 16:25:00 [显示全部帖子]

解决两个问题,panel还是看不见,原因待查:

 

Dim split As WinForm.SplitContainer
Dim pnl As WinForm.Panel
Dim tbl As WinForm.Table
Dim but As WinForm.Button

With e.form
' 创建split分隔
  split = e.Form.CreateControl("split1", ControlTypeEnum.splitcontainer)
  split.Dock = Windows.Forms.DockStyle.Fill
  split.Orientation = windows.Forms.Orientation.horizontal
  split.splitterwidth = 4
  e.form.addcontrol(split)
  split.SplitterDistance = 500


'创建panel工具栏
  pnl = e.Form.CreateControl("pnl1", ControlTypeEnum.panel)
  pnl.SetBounds(200, 0, 400,40)
  pnl.Topmost = True
  pnl.backcolor= Color.FromARGB(187,0,10,203)
  split.panel1.AddControl(pnl)


'创建按钮
  but = e.Form.CreateControl("butadd", ControlTypeEnum.button)
  split.Panel1.AddControl(but)
  but.TopMost = True
End With


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/21 10:14:00 [显示全部帖子]

搞定:

 

 

Dim split As WinForm.SplitContainer
Dim pnl As WinForm.Panel
Dim tbl As WinForm.Table
Dim but As WinForm.Button

With e.form
    ' 创建split分隔
    split = e.Form.CreateControl("split1", ControlTypeEnum.splitcontainer)
    split.Dock = Windows.Forms.DockStyle.Fill
    split.Orientation = windows.Forms.Orientation.horizontal
    split.splitterwidth = 4
    e.form.addcontrol(split)
    split.splitterdistance =900
   
    '创建panel工具栏
    pnl = e.Form.CreateControl("pnl1", ControlTypeEnum.panel)
    pnl.SetBounds(0, 0, 400,400)
    split.panel1.AddControl(pnl)
    pnl.Topmost = True
    pnl.backcolor= Color.FromARGB(187,0,10,203)
   
    but = e.Form.CreateControl("butadd", ControlTypeEnum.button)
    split.Panel1.AddControl(but)
    but.TopMost = True
End With


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/21 14:59:00 [显示全部帖子]

这样一样可以的:

 

 

Dim split As WinForm.SplitContainer
Dim pnl As WinForm.Panel
Dim tbl As WinForm.Table
Dim but As WinForm.Button

With e.form
    ' 创建split分隔
    split = e.Form.CreateControl("split1", ControlTypeEnum.splitcontainer)
    split.Dock = Windows.Forms.DockStyle.Fill
    split.Orientation = windows.Forms.Orientation.horizontal
    split.splitterwidth = 4
    e.form.addcontrol(split)
    split.splitterdistance =900
   
    '创建panel工具栏
    pnl = e.Form.CreateControl("pnl1", ControlTypeEnum.panel)
    pnl.SetBounds(0, 0, 400,400)
    split.panel1.AddControl(pnl)
    pnl.Topmost = True
    pnl.backcolor= Color.FromARGB(187,0,10,203)
   
    but = e.Form.CreateControl("butadd", ControlTypeEnum.button)
    pnl.AddControl(but)
    but.TopMost = True
End With

 

 


 回到顶部