Foxtable(狐表)用户栏目专家坐堂 → [求助]按钮


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

主题:[求助]按钮

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


加好友 发短信
等级:七尾狐 帖子:1710 积分:11410 威望:0 精华:0 注册:2015/6/22 8:11:00
[求助]按钮  发帖心情 Post By:2023/6/19 15:17:00 [只看该作者]

老师好,我在两个分区面板里各集合了9个按钮但只能显示一个分区面板的按钮。

Dim str() As String = {"第一行","上一行","下一行","最末行","增加行","删除行","保存","修改","锁定"}               '          ,"材料计算","数据查询"}
For i As Integer = 1 To 9
    Dim t2 As WinForm.Button = Forms("系统").Controls("电" & i)
    t2.text =  str(i-1)
    t2.width = 70
    t2.height = 26
    t2.Top = 415
    t2.left = 30 + 75 * (i-1)       
    t2.Font = New Font("微软雅体", 10, FontStyle.Bold)
    t2.VisualStyle = VisualStyleEnum.office2010blue
    t2.TextAlign  = ContentAlignment.BottomCenter                                                   '垂直靠下,水平居中
    t2.ImageAlign = ContentAlignment.TopCenter                                                      '垂直靠上,水平居中
    t2.TextImageRelation = TextImageRelation.ImageAboveText                                         '图标在文本的上方上方
    e.Form.Controls("SplitContainer2") .Panel2.AddControl(t2)
Next




Dim str1() As String = {"第一行","上一行","下一行","最末行","增加行","删除行","保存","修改","锁定"}               '          ,"材料计算","数据查询"}
'Dim picname8() As String = {"1018","1019","1020","1021","1022"}
For i As Integer = 1 To 9
    Dim t1 As WinForm.Button = Forms("系统").Controls("水" & i)
    't2.Image = GetImage(ProjectPath &  "Attachments\图片\" & picname8(i-1)& ".jpg")
    t1.text =  str1(i-1)
    t1.width = 70
    t1.height = 26
    t1.Top = 420
    t1.left = 30 + 75 * (i-1)       '30左边距 90是90-80是按钮和按钮之间的间距
    t1.Font = New Font("微软雅体", 10, FontStyle.Bold)
    t1.VisualStyle = VisualStyleEnum.office2010blue
    t1.TextAlign  = ContentAlignment.BottomCenter                                                   '垂直靠下,水平居中
    t1.ImageAlign = ContentAlignment.TopCenter                                                      '垂直靠上,水平居中
    t1.TextImageRelation = TextImageRelation.ImageAboveText                                         '图标在文本的上方上方
    '''t2.BackColor =Color.DeepPink
    't2.Anchor = Windows.Forms.AnchorStyles.Top Or Windows.Forms.AnchorStyles.Bottom                 '锚定                                                                               '设置背景颜色
    '''e.Form.Controls("系统面板3").AddControl(t2)
    e.Form.Controls("SplitContainer3") .Panel2.AddControl(t1)
Next
[此贴子已经被作者于2023/6/19 15:20:23编辑过]

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


加好友 发短信
等级:超级版主 帖子:107304 积分:545781 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/6/19 15:28:00 [只看该作者]

其中一个改为Panel1

e.Form.Controls("SplitContainer2") .
Panel1.AddControl(t2)

 回到顶部