469,943 Members | 2,541 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,943 developers. It's quick & easy.

how can i create a multi-line textbox dynamically?

I need to create a multi-line label dynamically.

Since labels aren't multi-line, I'm creating a textbox and making it look
like a label with the multiline property set to true.

I want to increase the height of the textbox only if there are multiple
lines, and leave it at the default height if the text does not wrap after
setting the Text property.

I thought I could use the Lines property after setting the Text property,
but Lines is always = 1 even if the

I would appreciate any advise.

Thanks
Bill
Jan 23 '07 #1
2 3406

BillE wrote:
I need to create a multi-line label dynamically.

Since labels aren't multi-line, I'm creating a textbox and making it look
like a label with the multiline property set to true.

I want to increase the height of the textbox only if there are multiple
lines, and leave it at the default height if the text does not wrap after
setting the Text property.

I thought I could use the Lines property after setting the Text property,
but Lines is always = 1 even if the

I would appreciate any advise.

Thanks
Bill
I'm pretty sure I've had Multiline labels by adding a new-line
character to the string in the label. In the Designer View, edit the
Text property of the label, click on the down arrow to get the large
text edit box, then press Shift-Enter to go to a new line.
In code, use vbNewLine to add a new line.

Jan 23 '07 #2
Thanks Zoltar!
I created a label dynamically, set the minimum and maximum widths to be the
size I wanted, and set the Autosize to true so it would expand vertically.
It works great.

<lo*********@gmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
>
BillE wrote:
>I need to create a multi-line label dynamically.

Since labels aren't multi-line, I'm creating a textbox and making it look
like a label with the multiline property set to true.

I want to increase the height of the textbox only if there are multiple
lines, and leave it at the default height if the text does not wrap after
setting the Text property.

I thought I could use the Lines property after setting the Text property,
but Lines is always = 1 even if the

I would appreciate any advise.

Thanks
Bill

I'm pretty sure I've had Multiline labels by adding a new-line
character to the string in the label. In the Designer View, edit the
Text property of the label, click on the down arrow to get the large
text edit box, then press Shift-Enter to go to a new line.
In code, use vbNewLine to add a new line.

Jan 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Grahammer | last post: by
2 posts views Thread by ME | last post: by
2 posts views Thread by cpressley2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.