[RESOLVED] Centering text vertically
I attached two pictures of text boxes with password property
http://img358.imageshack.us/img358/8330/wa1qa9.png
and
http://img75.imageshack.us/img75/5513/watf6.th.png
As we can see the text in the second one is aligned in the middle(vertically) whereas the text in the first one is not.
So how do i center the text for the first text box??
p.s:The second one is the dialup interface of windows
Re: Centering text vertically
I think the font is just bigger, and the textbox is sized to the text, to give the effect that its centered.
chem
Re: Centering text vertically
Re: Centering text vertically
this is probably a fair bit simpler. use two textboxes.
VB Code:
' Text1 - the 'outside' box, set Locked = True and clear the text property at design time
' Text2 - the 'inside' box, set BorderStyle = None at design time
Private Sub Form_Load()
With Text2
.Height = 15 ' or 1-pixel
.Move Text1.Left + 15, (Text1.Height - .Height) \ 2 + Text1.Top
End With
End Sub
Private Sub Text1_GotFocus()
Text2.SetFocus
Text2.SelStart = Len(Text2.Text)
End Sub
Re: Centering text vertically
Interesting...I might use that from now on then :p
chem
Re: Centering text vertically
Wow Thats look cool .Nice hack .thanks bush