Hi Unless you don't want to use a larger font then try setting the font size for those four boxes to a larger size (the TextBoxes will resize to accomodate the larger font) Is that a typo - the first line of posted code where you set TextBox1 (I am supposing it was meant to be TextBox4?) Here is an example using 3 TextBoxes of 6: ![51035-1.png][1] ' FORM1 with 6 ' TextBoxes (1-6) Option Strict On Option Explicit On Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim fs As Single = 16 With TextBox1 .Font = New Font(.Font.FontFamily, fs) .TextAlign = HorizontalAlignment.Center .Text = "TextBox1" End With With TextBox2 .Font = New Font(.Font.FontFamily, fs) .TextAlign = HorizontalAlignment.Center .Text = "TextBox2" End With With TextBox3 .Font = New Font(.Font.FontFamily, fs) .TextAlign = HorizontalAlignment.Center .Text = "TextBox3" End With With TextBox4 .Text = "TextBox4" End With With TextBox5 .Text = "TextBox5" End With With TextBox6 .Text = "TextBox6" End With End Sub End Class [1]: /api/attachments/51035-1.png?platform=QnA
Textbox Height and text Alignment for four textboxes
Hi Great People.
I have 4 textboxes that need to be bigger height than the rest of the textboxes.
How can I manipulate the text to be centre of these 4 textboxes.
I cannot seem to change the Properties on the Textboxes
I have tried using Multiline. but cannot get the result I require. ( Picture Below )
They have to be textboxes because a user has to enter numeric values.
on form Load I have this code...
Imports System.Windows.Forms.VisualStyles
Public Class FrmVAT
Private Sub FrmVAT_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.TextBox1.AutoSize = False
Me.TextBox4.Height = 50
Me.TextBox4.TextAlign = HorizontalAlignment.Center
Me.TextBox4.TextAlign = VerticalAlignment.Center
Me.TextBox13.AutoSize = False
Me.TextBox13.Height = 50
Me.TextBox13.TextAlign = HorizontalAlignment.Center
Me.TextBox13.TextAlign = VerticalAlignment.Center
Me.TextBox8.AutoSize = False
Me.TextBox8.Height = 50
Me.TextBox8.TextAlign = HorizontalAlignment.Center
Me.TextBox8.TextAlign = VerticalAlignment.Center
Me.TextBox17.AutoSize = False
Me.TextBox17.Height = 50
Me.TextBox17.TextAlign = HorizontalAlignment.Center
Me.TextBox17.TextAlign = VerticalAlignment.Center
End Sub
Kind regards
Gary
1 additional answer
Sort by: Most helpful
-
Viorel 118.2K Reputation points
2020-12-24T15:48:20.903+00:00 You can remove the border of textbox, insert a Panel control that has a border and BackColor=Window, then place the textbox inside this panel. These operations can be done in Form Designer.