
如何用vb6中的for循环画出图中的绿色方框,下面是其中一个的编程,非常着急,在线等,答得好再加分
PrivateSubDrive1_Change()EndSubPrivateSubImage1_Click()EndSubPrivateSubForm_Load()Lis...
Private Sub Drive1_Change()
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Form_Load()
ListView1.ListItems.Add 1, , "sdgsgd"
ListView1.ListItems.Add 2, , "s4545gd"
ListView1.ListItems.Add 3, , "sdertergd"
ListView1.ListItems.Add 4, , "sderterterd"
End Sub
Private Sub MSChart1_OLEStartDrag(Data As MSChart20Lib.DataObject, AllowedEffects As Long)
End Sub
Private Sub Timer1_Timer()
Picture1.Cls
Picture1.Line (150, 240)-(1230, 1480), QBColor(3), BF 'icon
Picture1.CurrentX = 100
Picture1.CurrentY = 300
Picture1.Print Rnd * 1000
End Sub 展开
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Form_Load()
ListView1.ListItems.Add 1, , "sdgsgd"
ListView1.ListItems.Add 2, , "s4545gd"
ListView1.ListItems.Add 3, , "sdertergd"
ListView1.ListItems.Add 4, , "sderterterd"
End Sub
Private Sub MSChart1_OLEStartDrag(Data As MSChart20Lib.DataObject, AllowedEffects As Long)
End Sub
Private Sub Timer1_Timer()
Picture1.Cls
Picture1.Line (150, 240)-(1230, 1480), QBColor(3), BF 'icon
Picture1.CurrentX = 100
Picture1.CurrentY = 300
Picture1.Print Rnd * 1000
End Sub 展开
1个回答
展开全部
用控件数组做吧!先画一个picture控件,控件名就是picture1,index属性是0,visable属性是false,同时设置好颜色
Private Sub Form_Load()
x = 1
y = 1
For i = 0 To 7
For n = 1 To 16
Load Picture1(i * 16 + n)
Picture1(i * 16 + n).Left = x + (n - 1) * Picture1(i * 16 + n).Width + (n - 1) * 50
Picture1(i * 16 + n).Top = y + i * Picture1(i * 16 + n).Height + i * 20
Picture1(i * 16 + n).Visible = True
Next
Next
End Sub
Private Sub Form_Load()
x = 1
y = 1
For i = 0 To 7
For n = 1 To 16
Load Picture1(i * 16 + n)
Picture1(i * 16 + n).Left = x + (n - 1) * Picture1(i * 16 + n).Width + (n - 1) * 50
Picture1(i * 16 + n).Top = y + i * Picture1(i * 16 + n).Height + i * 20
Picture1(i * 16 + n).Visible = True
Next
Next
End Sub
追问
貌似不行啊
追答
本地测试是好的,但是你的程序是需要结合你的程序来修改的,不能直接复制就能用!OK!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询