Guest_imported
New member
- Jan 1, 1970
- 0
I have the following code:
Basically, it is supposed to create 10 Labels at run-time as part of a control array. Label(0) exists at design-time. Now, as I create these labels, I want to store them inside the frame called 'fraButtons', which is just a standard frame control. So, I attempt to change the Container property of each label to 'fraButtons'. However, I then get the following run-time error on the Container line:
Control "Caption Here" not found.
Where the text "Caption Here" is whatever the caption of fraButtons happens to be.
Now, I could understand if it failed because the frame didn't exist yet or something, but what on earth has the frame's caption got to do with anything? Or am I doing something very wrong?
Using VB6 on Win98.
Code:
Private Sub Form_Load()
For x = 1 To 10
Load Label1(x)
With Label1(x)
.Container = fraButtons
.Caption = x
.Left = 100 * x
.Visible = True
End With
next
end sub
Control "Caption Here" not found.
Where the text "Caption Here" is whatever the caption of fraButtons happens to be.
Now, I could understand if it failed because the frame didn't exist yet or something, but what on earth has the frame's caption got to do with anything? Or am I doing something very wrong?
Using VB6 on Win98.