在线等待-100分(一个简单问题,新手高手都来瞧瞧)

egg0817 2004-01-17 12:52:51
1.假设窗体上已有64个PictureBox,是控件数组,即Picture1(0)到Picture1(63)
2.我现在要把它们排成8*8的方型

请帮忙吧 呵呵
...全文
113 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
mmcgzs 2004-01-17
  • 打赏
  • 举报
回复
Dim i As Long
dim dtop as long
dim dleft as long
For i = 0 To 63

if i mod 8=0 then
dtop=100
dleft=100
end if

picture1(i).left=dleft
picture1(i).top=dtop
dleft=dleft+picture1(i).width
dtop=dtop+picture1(i).height
Next i
nik_Amis 2004-01-17
  • 打赏
  • 举报
回复
。。。
KJ_Wang 2004-01-17
  • 打赏
  • 举报
回复
给你个思路:
1、先得出你的窗体的长、宽;
2、然后将长、宽分别分除以8,每一个Picture.height=me.height/8
Picture.width=me.width/8
3、然后再将每一个PICTUREBOX移到相应的位置就可以了。
rainstormmaster 2004-01-17
  • 打赏
  • 举报
回复
宝贝的就可以了,当然参数你可能需要修改一下
lk_cool 2004-01-17
  • 打赏
  • 举报
回复
d
jhzhou882 2004-01-17
  • 打赏
  • 举报
回复
调整好两行
然后保存
然后把窗体用文本打开
注意观察
然后就可以修改文本 保存
再用VB打开窗体
OK了
wzcgy 2004-01-17
  • 打赏
  • 举报
回复
同意
nicolas1999king 2004-01-17
  • 打赏
  • 举报
回复
同意宝贝
northwolves 2004-01-17
  • 打赏
  • 举报
回复
Private Sub Form_Load()
Me.Move 1000, 500, 9000, 9000
On Error Resume Next
Dim i As Long
For i = 0 To 63
Load Picture1(i)
Picture1(i).Visible = True
Picture1(i).Move 800 + 800 * (i \ 8), 500 + 800 * (i Mod 8), 800, 800
Next
End Sub
aalei 2004-01-17
  • 打赏
  • 举报
回复
dim DTcol as Integer

DTcol = Int(Sqr(DTcounts))
If DTcounts Mod DTcol = DTcol Then
For intI = 0 To DTcol - 1 '列
For intJ = 0 To DTcol - 1 '行
DTDisplay1(intI + intJ * DTcol).top = intJ * 1500 + 600
DTDisplay1(intI + intJ * DTcol).left = intI * 1200 + 700
end if
flc 2004-01-17
  • 打赏
  • 举报
回复
学习
yassee 2004-01-17
  • 打赏
  • 举报
回复
dim mtop as integer,mleft as integer,i as integer,j as integer
mtop=0
for i=1 to 8
mleft=50
for j=1 to 8
k=(i-1)*8+j
load picturebox(k)
picturebox(k).visible=true
picturebox(k).top=mtop
picturebox(k).left=mleft
mleft=mleft+picturebox(0).width
next j
mtop=mtop+picturebox(0).height
next i
没测试过?
xuchuang 2004-01-17
  • 打赏
  • 举报
回复
Dim i As Long

For i = 0 To 63
Call Me.Picture1(i).Move((i Mod 8) * 1000, (Int(i / 8) + 1) * 1000, 1000, 1000)
Next i

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧