Click here to Skip to main content
13,195,163 members (72,293 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hi i have a form that it has a lable.the autosize property of this lable set to true .the text of this lable may grow on limited and some line of this text will not display in form area how can i grow this form when lable gorws automaticlly
Posted 5-Jan-13 21:40pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There is no automatic way to do that - anchoring doesn't work with autosize labels.

You will have to handle the Label SizeChanged event and update the Form Width and Height appropriately.

Personally, I would probably use a ReadOnly Text box instead, and enable scrolling - a form which changes height is going to look odd to the user.
behrad110 6-Jan-13 4:09am
hi thanks for replay but i wanna grow form if number lines were more than size of text box or lable
OriginalGriff 6-Jan-13 4:24am
I think it will look odd, but go ahead - handle the event, and do it.
sariqkhan 6-Jan-13 5:07am
og sir can you help me here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171019.1 | Last Updated 6 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100