yeggstry
asked on
Creating objects on a form using Form_Load.....
Ok, this one is a bit harder.
I want 31 new labels for my form, with the values 1 - 31. I know there must be an easier way to add them other then manually enter them in, so I thought I would ask the experts!!
I appreciate any help
Lewis Keen
a.k.a Yeggstry
I want 31 new labels for my form, with the values 1 - 31. I know there must be an easier way to add them other then manually enter them in, so I thought I would ask the experts!!
I appreciate any help
Lewis Keen
a.k.a Yeggstry
ASKER
cheers, i will try, but any other solutions are welcome!!
also you can add one label to your form, name it lblNumbers and set its index property to 0. then:
Dim cnt as Integer
for cnt = 1 to 31
Load lblNumbers(lblNumbers.UBou nd + 1)
With lblNumbers(lblNumbers.UBou nd)
.Top = lblNumbers(lblNumbers.UBou nd - 1).Top + .Height
.Left = 10
.Caption = cnt
.Visible = True
End With
Next cnt
Dim cnt as Integer
for cnt = 1 to 31
Load lblNumbers(lblNumbers.UBou
With lblNumbers(lblNumbers.UBou
.Top = lblNumbers(lblNumbers.UBou
.Left = 10
.Caption = cnt
.Visible = True
End With
Next cnt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ameba,
thats interesting.
thats interesting.
Why did you punish me with a B ???
If something wasn't clear, you should have asked for clarification or for more info.
Do NOT expect any further help from me!
If something wasn't clear, you should have asked for clarification or for more info.
Do NOT expect any further help from me!
ASKER
grow up ameba
I gave you a B because your answer was sufficient, but could have been better.
I gave you a B because your answer was sufficient, but could have been better.
>grow up ameba
Some people really don't deserve ANY HELP!
Some people really don't deserve ANY HELP!
Well, I've found my way to this question rather indirectly. However, B grades are not given if the answer was sufficient. Yeggstry, I'll gladly post the guidelines for grading. If you did not know the answer, how could you possibly know that the answer could have been better?
Changing grade to an A...
amp
Community Support Moderator
Changing grade to an A...
amp
Community Support Moderator
Dim cnt As Integer
LastTop = 0
For cnt = 1 to 31
Set lbl = Me.Controls.Add("VB.Label"
With lbl
.Move 10, cnt
.AutoSize = True
.Visible = True
.Caption = cnt
End With
Next cnt
try that maybe?