Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Dynamic Resizing of TextBox

Mar 20 2003 4:46 PM
Hi, I am trying to create a class that is derived from TextBox that has the ability to automatically resize as text is added to it. When the TextBox is created it will have a default width and height (Height is set to allow one line of text to be visible). As the user enters text and reaches the right hand side of the TextBox, I need to increase the height of the text box to allow the second line to be seen and so on. The reverse behaviour is required as text is removed, the box must resize to be the minimal size required to show all lines. Also, the TextBox has the multiline property set to TRUE. I cannot use scrollbars as the user must be able to see all text all once. I've checked the .NET documentation and have not been able to locate a property or event that will allow me to detect this situation and take the appropriate action. Any assistance (sooner rather later ;-) would be much appreciated. Cheers, Benjamin

Answers (3)