Zexor
Well-known member
- Joined
- Nov 28, 2008
- Messages
- 520
- Programming Experience
- 3-5
I have notice that a control's location sometime changes after adding to a container, why is that?
it doesnt happen all the time, just sometime. Thats why its weird. What happen?
VB.NET:
Dim panel As New Panel
panel.Size = New Size(flowAVPanel.Width - 31, 40)
flowAVPanel.Controls.Add(panel)
Dim tb As New TextBox
With tb
.Multiline = True
.Size = New Size(200, 40)
.Location = New Point(0, 0)
.TextAlign = HorizontalAlignment.Center
.BackColor = Color.SeaGreen
.Font = New Font(tb.Font.FontFamily, 20)
.Enabled = False
.Text = "ABC"
End With
msgbox(tb.location)'this one at 0,0
panel.Controls.Add(tb)
msgbox(tb.location)'this one at 0,-87