|
-
Dec 27th, 2001, 10:29 PM
#1
Thread Starter
Frenzied Member
center text vertically in label?
Hi,
I need to be able to vertically center the caption in a label. How can this be done? Seems like it might be an API thing...
Thanks,
Dan
-
Dec 27th, 2001, 10:31 PM
#2
Member
The Align property? Or do you mean have the letters rotated 90°?
-
Dec 27th, 2001, 10:36 PM
#3
Frenzied Member
I don't believe there is a way to rotate a label...you can have the letters still upright but put newlines between each letter....
just my $0.02
-
Dec 27th, 2001, 10:48 PM
#4
Originally posted by filburt1
The Align property? Or do you mean have the letters rotated 90°?
I believe he means like this...
--------
Caption
--------
that's how a label normally works, he wants...
--------
Caption
--------
am I right?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 27th, 2001, 10:50 PM
#5
Registered User
Originally posted by SteveCRM
I don't believe there is a way to rotate a label...you can have the letters still upright but put newlines between each letter....
just my $0.02
Steve you can make a custom control to do that if you want to, here is code you could use to do it:
http://www.vbforums.com/showthread.p...ghlight=rotate
I think Microbasic has made a control to do it, ask him if you need it.
-
Dec 28th, 2001, 12:06 AM
#6
Thread Starter
Frenzied Member
crptcblade is correct.
Also, if the font gets changed, I need the caption to remain horizontally and vertically centered..
Is this possible?
-
Dec 28th, 2001, 01:08 AM
#7
PowerPoster
hmmm
i think that this is a little bit less complex than it needs to be. If the 'text' in the label fills less than the label height u could simply set the label to autosize and set its top position to half way (less half the label height) between the designated top and bottom positions.
Is there some design reason in your form that this approach would not be feasible?
Regards
Stuart
-
Dec 28th, 2001, 06:08 AM
#8
I'm doing it here with 2 labels. Just centering one over the other.
VB Code:
Private Sub Form_Load()
With Label1
.Alignment = vbCenter
.BorderStyle = vbFixedSingle
End With
With Label2
.Width = Label1.Width - 100
.Left = Label1.Left + 50
.Top = Label1.Top + ((Label1.Height - .Height) \ 2)
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|