+ -
当前位置:首页 → 问答吧 → 我做VB程序遇到的小问题,求助中,急交作业

我做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等等属性是怎么样用的哦?

作者: fanlage   发布时间: 2011-12-26

把command控件的style属性设为1

作者: liuxingvcvc   发布时间: 2011-12-26

command1.style=Graphical

作者: Leftie   发布时间: 2011-12-26

热门下载

更多