I am trying to automatically create a series of 2 labels on a FlowControlPanel but I just cant get the allignment correct.
I have the following coded.
Code:
Dim x As Integer
For x = 0 To 50
Dim lbl As New Label()
Dim Tlbl As New Label
With lbl
.Size = New Size(400, 20)
.BackColor = Color.FromKnownColor(KnownColor.ControlLight)
.FlatStyle = FlatStyle.Flat
.Font = New System.Drawing.Font("Century", 12)
.TextAlign = ContentAlignment.MiddleLeft
.Margin = New Padding(124, 10, 0, 0)
.Text = "Downtime " & x
End With
With Tlbl
.Size = New Size(100, 20)
.BackColor = Color.FromKnownColor(KnownColor.ControlLight)
.FlatStyle = FlatStyle.Flat
.Font = New System.Drawing.Font("Century", 12)
.TextAlign = ContentAlignment.MiddleLeft
.Margin = New Padding(10, 10, 0, 0)
.Text = "Time " & x
End With
DataFLP.Controls.Add(lbl)
DataFLP.Controls.Add(Tlbl)
Next
This basically creates a series of 2 labels that span horizontally as I have it set to Top Down, so that I get a horizontal Scroll bar instead of vertical.
All the controls are added fine but the problem I am having is all the tlbl labels are added next to my lbl labels but under the lbl label. I want my labels side by side not side then under.
I want the Time Labels and the Downtime labels alligned side by side.
I have played with the padding and margins but just cant get them alligned, I have attached a picture of what I am getting and what I am looking for.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.