wie richte ich einen Text in einem Textfeld horizonal mittig ausrichten?
Vertikal funktioniert es ja unter Eigenschaften:
TextAlign = 2 - fmTextAlignCenter
Gruß
Timm
Private Sub Form_Current()
Dim intTextHeight As Integer
Dim intControlHeight As Integer
intTextHeight = Me.TextBox.TextHeight(Me.TextBox.Value)
intControlHeight = Me.TextBox.InsideHeight
Me.TextBox.Top = (intControlHeight - intTextHeight) / 2
End Sub
Sub Test3()
Dim TextHeight As Integer
Dim ControlHeight As Integer
TextHeight = uf02.TextBox1.TextHeight(uf2.TextBox1.Value)
ControlHeight = uf02.TextBox1.InsideHeight
uf02.TextBox1.Top = (ControlHeight - TextHeight) / 2
End Sub
Beim Ausführen erhalte ich jedoch die folgende Fehlermeldung: