我做VB程序遇到的小问题,求助中,急交作业
马上要交用VB做的扫雷的游戏,我在picturebox里面画了一个command控件数组,用
- VB code
Private Sub Form_Load()Set Image1.Picture = ImageList1.ListImages(1).Picturebox(0).Width = (Picture1.Width - 550) / 10box(0).Left = Picture1.ScaleLeft + 50box(0).Height = box(0).Widthbox(0).Top = Picture1.ScaleTop + 50For i = 1 To 99Load box(i) '加载小方块box(i).Visible = Truebox(i).Width = box(0).Widthbox(i).Left = Picture1.ScaleLeft + 50 + (box(0).Width + 50) * (i Mod 10)box(i).Height = box(0).Widthbox(i).Top = Picture1.ScaleTop + 50 + (box(0).Width + 50) * Int(i / 10)NextEnd Sub
加载了10*10的小方块,box是command数组的名字,然后我在command上面随机生成1到3的数字,希望判断在command的caption为3的时候在command的picture里面显示图片,结果不行,很郁闷,command.picture等等属性是怎么样用的哦?
[解决办法]
把command控件的style属性设为1
[解决办法]
command1.style=Graphical