【发布时间】:2016-05-22 04:21:33
【问题描述】:
目前正在学习 vb6 的高中生在尝试设置这些图像框的左值和上值时遇到了这个主要问题。我不断收到错误:
对象变量或未设置块变量
并且调试似乎将其引导到左侧和顶部值变量。
Option Explicit
Dim GapY As Integer
Dim GapX As Integer
Dim x As Integer
Dim y As Integer
Dim Tile() As Image
Dim NumOfTiles
Dim h, i As Integer 'Counter
Private Sub cmdRender_Click()
x = 480
y = 480
GapX = Val(InputBox("Enter How Many tile you want horizontally:"))
GapY = Val(InputBox("Enter How Many tile you want vertically"))
NumOfTiles = (GapY * GapX)
ReDim Tile(NumOfTiles)
For i = 1 To GapY
For h = 1 To GapX
Tile(h).Height = 615
Tile(h).Width = 615
Tile(h).Left = x
Tile(h).Top = y
'Tile(h).Stretch = True
x = x + 600
Next
y = y + 600
x = 480
Next
End Sub
【问题讨论】:
标签: vb6