我做VB程序遇到的小问题,求助中,急交作业
时间:2011-12-26
来源:互联网
马上要交用VB做的扫雷的游戏,我在picturebox里面画了一个command控件数组,用
Private Sub Form_Load()
Set Image1.Picture = ImageList1.ListImages(1).Picture
box(0).Width = (Picture1.Width - 550) / 10
box(0).Left = Picture1.ScaleLeft + 50
box(0).Height = box(0).Width
box(0).Top = Picture1.ScaleTop + 50
For i = 1 To 99
Load box(i) '加载小方块
box(i).Visible = True
box(i).Width = box(0).Width
box(i).Left = Picture1.ScaleLeft + 50 + (box(0).Width + 50) * (i Mod 10)
box(i).Height = box(0).Width
box(i).Top = Picture1.ScaleTop + 50 + (box(0).Width + 50) * Int(i / 10)
Next
End Sub
加载了10*10的小方块,box是command数组的名字,然后我在command上面随机生成1到3的数字,希望判断在command的caption为3的时候在command的picture里面显示图片,结果不行,很郁闷,command.picture等等属性是怎么样用的哦?
Private Sub Form_Load()
Set Image1.Picture = ImageList1.ListImages(1).Picture
box(0).Width = (Picture1.Width - 550) / 10
box(0).Left = Picture1.ScaleLeft + 50
box(0).Height = box(0).Width
box(0).Top = Picture1.ScaleTop + 50
For i = 1 To 99
Load box(i) '加载小方块
box(i).Visible = True
box(i).Width = box(0).Width
box(i).Left = Picture1.ScaleLeft + 50 + (box(0).Width + 50) * (i Mod 10)
box(i).Height = box(0).Width
box(i).Top = Picture1.ScaleTop + 50 + (box(0).Width + 50) * Int(i / 10)
Next
End Sub
加载了10*10的小方块,box是command数组的名字,然后我在command上面随机生成1到3的数字,希望判断在command的caption为3的时候在command的picture里面显示图片,结果不行,很郁闷,command.picture等等属性是怎么样用的哦?
作者: fanlage 发布时间: 2011-12-26
把command控件的style属性设为1
作者: liuxingvcvc 发布时间: 2011-12-26
command1.style=Graphical
作者: Leftie 发布时间: 2011-12-26
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28