How to put objects [labels] within forms
Posted
#1
(In Topic #864)
Trainee
I have no problem creating the forms, it is attaching/inserting objects
Code
' create forms
hForm = New Object[8]
For siCount = 0 To 7
With hForm[siCount] = New Form
.Name = "bForm"
.X = siCount * 50
.Y = siCount * 50
.W = 430
.H = 480
.Caption = "bCache " & Str(siCount) & " Form"
'.Show
End With
With Labelx = New Label(Me) As "Labelx"
.Y = 50
.X = 20
.W = 175
.H = 28
.Alignment = Align.Center
.Font.Bold = True
.Border = Border.Plain
.Text = "Test"
End With
Object.Attach(Labelx, hForm[siCount], "Labelx" & Str(siCount))
Next
If I can get an example of placing 2 labels in a form, I would be much appreciative
Thank you in advance
Posted
Trainee
Code
With Labelx = New Label(me) As "Labelx"with this
Code
With Labelx = New Label(hForm[siCount]) As "Labelx"Labels are showing up in forms
Posted
Guru

BTW. you should ditch either using As "labelx" in the form creation or using the Object.Attach() call as they both do the same thing.
Eg..
Code (gambas)
- .Name = "bForm"
- .X = siCount * 50
- .Y = siCount * 50
- .W = 430
- .H = 480
- '.Show
- .Y = 50
- .X = 20
- .W = 175
- .H = 28
- .Alignment = Align.Center
- .Border = Border.Plain
- .Text = "Test"
1 guest and 0 members have just viewed this.



