Click here to Skip to main content
14,300,999 members
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Sir,
I am developing user define control and i want to resize the control when i use in my project but i am not able to resize the textbox but i can resize the control
how to resize the textbox on design time.
Please repply.
Updated 1-Feb-12 1:09am
Sanjay K. Gupta 1-Feb-12 7:12am
First try it yourself. Learn more about it on the net. If you get any discrepancy, then post here.

Best of Luck!
satoshtiwari 1-Feb-12 7:14am
Thanks for reply i tried my best but did not get any solutions
Amir Mahfoozi 1-Feb-12 7:30am
WPF ? ASP.NET ? or what ?

1 solution

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

Solution 1

Unless you are using WPF, textboxes don't resize well vertically - the font size is fixed, and does not vary automatically relative to the control height. If you want the text to change size (which is the only practical way to change the height of a single line text box) then you will need to handle the Controls SizeChanged event and alter the font size yourself.
Resizing it horizontally is just a case of setting the Anchor property correctly.

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

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