Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Dynamic Behaviour of Text Boxes

Mar 16 2003 9:02 PM
Hi, I previously posted some messages about implementing text boxes directly in GDI to get behaviour like Visio and other diagram tools for entering text on shapes. I was given some strong guidance to use a TextBox with BorderStyle set to None to get the text field however its behaviour is not as I would like. When the user presses enter or excepts the width of the field, it should automatically expand to include multiple lines. I was thinking that I need to subclass TextBox to create my own custom TextBox control that will automatically resize as required. This means checking when the user presses enter, or the width exceeds the allowed size for the control. Does this sound correct to people, or can someone suggest a better approach. Thanks in advance, bmac.