CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    65

    Creating Custom Multiline TextBox (Memo)

    Ok, I want to start off by developing a Memo component having InsertAt(), RemoveAt(),etc. features to ease me in future projects. But I don't have an idea so as where to start from.

    * How can I inherit the System.TextBox control. (Just straight away in a C# class or do I have to make a new project)
    * I need that control to be later available in the Developer Toolbox. How can I integrate it.

    Or is there any visual class I'm missing that enacts the Memo component. (Not the ArrayList, but a visual component)

    Any help is appreciated. Thanks

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Creating Custom Multiline TextBox (Memo)

    Quote Originally Posted by nbaztec View Post
    * How can I inherit the System.TextBox control. (Just straight away in a C# class or do I have to make a new project)
    Not sure what you mean by that. All of your classes will be contained in a project. You inherit from the TextBox class just like you would any other class.

    * I need that control to be later available in the Developer Toolbox. How can I integrate it.
    Classes that derive from Control will be added to the toolbox automatically after you build the project.

  3. #3
    Join Date
    Jun 2009
    Posts
    65

    Re: Creating Custom Multiline TextBox (Memo)

    Quote Originally Posted by BigEd781 View Post
    Not sure what you mean by that. All of your classes will be contained in a project. You inherit from the TextBox class just like you would any other class.



    Classes that derive from Control will be added to the toolbox automatically after you build the project.
    I overcame the inheritance & integration problem. (Inherited from UserControl, added a TextBox then added to Toolbox using compiled DLL).

    But now I need to incorporate a feature by combining the best of TextBox & ArrayList to create a TMemo.
    I hence need to be able to update the ArrayList property automatically whenever the TextBox in my component is updated. So whenever I call Memo.Sort(), it should automatically store the TextBox.Text property to ArrayList object from where it Sorts using ArrayList.Sort() then store back to TextBox.Text.

    One way is to create custom methods binding all. Is there any way other than this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured