954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Auto expanding a label

I have a program that outputs a series of items onto a form--an "invoice" if you would like. The problem is, when the user enters in more items than the invoice's size can handle the rest just disappears into the mysterious realm down at the bottom.

Is there a way where I can make the label automatically detect items going in and create a vscrollbar or something similar so that it can accommodate it's size?

Thanks.

yongj
Junior Poster in Training
79 posts since May 2010
Reputation Points: 11
Solved Threads: 1
 

Add a Panel to your Form, set "AutoScroll" in Panel's Properties to "True" and place your Label inside the Panel.

codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 
Add a Panel to your Form, set "AutoScroll" in Panel's Properties to "True" and place your Label inside the Panel.


Would the label automatically expand with the panel as well then?

yongj
Junior Poster in Training
79 posts since May 2010
Reputation Points: 11
Solved Threads: 1
 

If you re-size the Panel to the Label's size, it should show scroll-bars on the Panel once you add more than one line of text in the Label.

codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 

Just for references, "please test the solution provided before re-asking your question".
Thank you.

codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 
If you re-size the Panel to the Label's size, it should show scroll-bars on the Panel once you add more than one line of text in the Label.


I made panel and placed a label with the same size inside the panel but no scroll bar when the text in the label extends past the dimensions! :(

yongj
Junior Poster in Training
79 posts since May 2010
Reputation Points: 11
Solved Threads: 1
 

Nevermind. The label needed to be on autosize for it to work! :D

yongj
Junior Poster in Training
79 posts since May 2010
Reputation Points: 11
Solved Threads: 1
 

set the label's autosize property to true

Netcode
Veteran Poster
1,021 posts since Jun 2009
Reputation Points: 43
Solved Threads: 67
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: