Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2007

Tip: Looking for answers? Try searching our database.

Programmatically changing the size of a textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Gower - 19 Jul 2007 22:50 GMT
I have a textbox that is multiline but I only want to show one line at the
start until that line is filled in.  I am going to use the textchanged event
to check the length of the text in the field.  If the length of the text is
greater than the length of the field, I am going to change the height of the
textbox to show another line and when that is filled I am going to add a new
line etc etc.  My question is what is the easiest way to move all the
controls below this textbox down?

Bill
Clive Dixon - 20 Jul 2007 09:56 GMT
If you also need to change the size of the form the fit the resized text box
and all the controls below it, then the easiest way is to anchor all the
controls below to the bottom edge of the form (add AnchorStyles.Bottom to
the Anchor property of the controls), then just resize the form by the
amount you need to increase the textbox by. You can also include the textbox
itself in the anchoring so you only have to resize the form.

>I have a textbox that is multiline but I only want to show one line at the
>start until that line is filled in.  I am going to use the textchanged
[quoted text clipped - 5 lines]
>
> Bill

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.