Results 1 to 3 of 3

Thread: TextBox Replacment

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521

    TextBox Replacment

    My goal is some sort of multiline, unlimited length (unlike TextBox) edit control, with which I can apply different fonts, text colors, and highlight colors. I do NOT want to use the RichTextBox, because it is just too slow. I wrote a function to color Transact-SQL code like Microsoft's Query Analyzer does, and it can take a minute to apply the coloring to a 100 KB file. Anyways, I don't need a control that can load/save rich text documents -- the control will color the document based on a set of rules (like Query Analyzer). I know there's at least one control (CodeMax) that provides this sort of functionality, but it's written in C++ and therefore not an option (it must be maintainable and my company doesn't use C++).

    Does anyone here know of a usercontrol written to perform the above functionality or a more basic one, that does NOT inherit Microsoft's TextBox or RichTextBox controls? This would include code that shows the blinking cursor at the rate the user has specified in settings, storage schemes for text, selecting of text, etc.

    Actually, any direction on building a TextBox from Control or UserControl (again, not inheriting from TextBox or RichTextBox) would be very helpful.

    Thanks in advance.
    I have two simple requests: 1) Use useful and specific topics. 2) Modify your topic to include [Resolved] when you problem has been resolved. Both of these make the bulletin boards more useful and efficient. Thanks.

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    If you want something faster, then you will probably have to look to C++.

    I'm sure there are ways (which others will talk about I'm sure) but it wills till be in VB and if micrsoft's own textboxes were too slow, I HIGHLY doubt you'll see any performance increase, if any by making your own or downloading a VB replacement.

    Just to apply some colors and fonts to a 100kb file, I can't see that taking soo long, are you sure the routines to highlight things are good?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521
    .NET's RichTextBox times for coloring files increases more than O(n) time vs. file size, so I'd guess that it stores all its text in an array or something akin to that. If you've ever tried redimming and preserving a 100KB array, you'll know what I'm talking about. In addition, the RichTextBox stores its contents as Rich Text -- something I don't need to do. I can have my text box color text based on keywords, which means I don't have to change the text in any way. I think .NET will draw a pageful of text quite quickly...
    I have two simple requests: 1) Use useful and specific topics. 2) Modify your topic to include [Resolved] when you problem has been resolved. Both of these make the bulletin boards more useful and efficient. Thanks.

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