|
-
May 31st, 2007, 12:58 AM
#1
Thread Starter
Hyperactive Member
[2005] AutoSize Property
I have a label whose AutoSize Property is set to true. It's size inside the IDE is {64, 13}. It's size at runtime is {64, 18}. I do not have any code that is changing is Size property or it's AutoSize property.
I am wondering why this is happening? Also, if anybody else has had this problem and knows how to fix it?
A similar inquery. Is there a way if I could check the height of the text in the label then change it's height based on that. I know there is a MeasureString function, but from what I have read it only gets the width of the text based on it's font.
Thanks, Troy
Prefix has no suffix, but suffix has a prefix.
-
May 31st, 2007, 01:05 AM
#2
Frenzied Member
Re: [2005] AutoSize Property
To answer your first question, if the AutoSize property is set to True, the label will expand to fit its text. If you want a fixed size then set its AutoSize property to False.
-
May 31st, 2007, 01:55 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] AutoSize Property
I know what AutoSize does. I am saying the label's height increases for no apparent reason.
How about this. Is there a way to align the middle's of two controls in code.
I am currently using
Code:
ctrl2.Top = Cint(ctrl1.height / 2) - (ctrl2.height / 2)
Prefix has no suffix, but suffix has a prefix.
-
May 31st, 2007, 07:48 AM
#4
Re: [2005] AutoSize Property
Dim tSize As System.Drawing.SizeF = e.Graphics.MeasureString(label1.text, label1.font)
MsgBox(tSize.Height)
' that'll measure your label text height
try:
(ctrl1.height - ctrl2.height) / 2
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
|