I have read a few articles on this but none seem to help. How do I align the label and textbox in the following case:
Using frm As New frmWithTableLayout
frm.TableLayoutPanel1.ColumnCount = 2
frm.TableLayoutPanel1.RowCount = 3
'create report Type'
Dim lblReportType As New Label
lblReportType.Text = "Report Type"
lblReportType.Dock = DockStyle.Right
Dim reportType As New System.Windows.Forms.TextBox()
reportType.Text = "Income"
frm.TableLayoutPanel1.Controls.Add(lblReportType, 0, 0)
frm.TableLayoutPanel1.Controls.Add(reportType, 1, 0)
End Using
The one that worked for me was this:
Label lblAmountInWords = new Label();
lblAmountInWords.Text = "FOUR THOUSAND THREE HUNDRED AND TWENTY ONLY";
lblAmountInWords.Font = new Font("Arial", 9, FontStyle.Bold);
lblAmountInWords.AutoSize = false;
lblAmountInWords.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
lblAmountInWords.TextAlign = ContentAlignment.MiddleCenter;
tableLayoutPanelAmountInWords.Controls.Add(lblAmountInWords, 0, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With