vfp表单中,如何插入一个三行五列共15个按钮的命令按钮组?
4个回答
展开全部
把下面的代码写到表单的init事件中
this.AddObject('CommandGroup1','CommandGroup')
With this.CommandGroup1
.ButtonCount = 15
.left = 0
.top = 0
.Height = 185
.Width = 220
Endwith
m.x = 10
m.y = 10
For i = 1 To 15
lcObject = 'Command' + Transform(i)
With thisform.CommandGroup1.&lcObject
.top = m.y
.left = m.x
.Height = 25
.Width = 60
Endwith
m.x = m.x + 60 + 10
If i % 3 == 0
m.x = 10
m.y = 10 + (25 + 10) * Int(i / 3)
Endif
Next
this.CommandGroup1.visible = .t.
this.AddObject('CommandGroup1','CommandGroup')
With this.CommandGroup1
.ButtonCount = 15
.left = 0
.top = 0
.Height = 185
.Width = 220
Endwith
m.x = 10
m.y = 10
For i = 1 To 15
lcObject = 'Command' + Transform(i)
With thisform.CommandGroup1.&lcObject
.top = m.y
.left = m.x
.Height = 25
.Width = 60
Endwith
m.x = m.x + 60 + 10
If i % 3 == 0
m.x = 10
m.y = 10 + (25 + 10) * Int(i / 3)
Endif
Next
this.CommandGroup1.visible = .t.
展开全部
添加一个按钮的命令如下。 其他的你自己添加吧。
thisform.AddObject("t1","commandbutton")
thisform.t1.left=10
thisform.t1.top=10
thisform.t1.visible=.t.
thisform.AddObject("t1","commandbutton")
thisform.t1.left=10
thisform.t1.top=10
thisform.t1.visible=.t.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
建立命令按钮组,然后将ButtonCount属性改为15,最后按你的想法人工排列即可
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-04-24
展开全部
直接添加不就好了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询