473,785 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Highlighter RichTextBox control

Hi,

thanks to the insight that Kevin Spencer gave me concerning my regular
expressions question from a few days ago, I managed to create a first
version of my (free) Highlighter RichTextBox control. In short: it
highlights portions of text in specified (fore- and background)colo rs,
with a specified parser.

I found a number of controls on the net, but all of them had some
problems: mostly performance issues with larger texts and flickering
problems.

Besides the fact that I needed to learn how regular expressions work,
I also needed to find a solution for the performance and flickering
issues.

The performance issues have been solved by only updating the part of
the text that needs to be updated; instead of the whole text. The
flickering issue has been solved by eating paint messages when it is
not needed to repaint the control.

A first version of the control can be downloaded at
http://www.coders-lab.be/mysoftware.html, if someone is intrested.

Always intrested in feedback on how to improve it.

Kind regards,
Ludwig

Apr 7 '06 #1
2 1923
Good work, Ludwig! Wish I had the time to try it out, but I'm swamped at the
moment. It sounds like you've got a solid Control there, though.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Ludwig" <no**@none.co m> wrote in message
news:93******** *************** *********@4ax.c om...
Hi,

thanks to the insight that Kevin Spencer gave me concerning my regular
expressions question from a few days ago, I managed to create a first
version of my (free) Highlighter RichTextBox control. In short: it
highlights portions of text in specified (fore- and background)colo rs,
with a specified parser.

I found a number of controls on the net, but all of them had some
problems: mostly performance issues with larger texts and flickering
problems.

Besides the fact that I needed to learn how regular expressions work,
I also needed to find a solution for the performance and flickering
issues.

The performance issues have been solved by only updating the part of
the text that needs to be updated; instead of the whole text. The
flickering issue has been solved by eating paint messages when it is
not needed to repaint the control.

A first version of the control can be downloaded at
http://www.coders-lab.be/mysoftware.html, if someone is intrested.

Always intrested in feedback on how to improve it.

Kind regards,
Ludwig

Apr 7 '06 #2
On Fri, 07 Apr 2006 12:40:44 +0200, Ludwig <no**@none.co m> wrote:
Hi,

thanks to the insight that Kevin Spencer gave me concerning my regular
expressions question from a few days ago, I managed to create a first
version of my (free) Highlighter RichTextBox control. In short: it
highlights portions of text in specified (fore- and background)colo rs,
with a specified parser.

I found a number of controls on the net, but all of them had some
problems: mostly performance issues with larger texts and flickering
problems.

Besides the fact that I needed to learn how regular expressions work,
I also needed to find a solution for the performance and flickering
issues.

The performance issues have been solved by only updating the part of
the text that needs to be updated; instead of the whole text. The
flickering issue has been solved by eating paint messages when it is
not needed to repaint the control.

A first version of the control can be downloaded at
http://www.coders-lab.be/mysoftware.html, if someone is intrested.

Always intrested in feedback on how to improve it.

Kind regards,
Ludwig


I forgot to ask my question :)

if a huge file is loaded (or pasted), it is parsed completely; but
this takes a very long time, especially the updating of the text in de
richtextbox takes forever for large amounts of texts.

Any suggestions on how to solve this?
Apr 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2585
by: vanvee | last post by:
Hi I have a user control that contains a RichTextBox in vb.net. In my program, I create multiple instances of this control (with the RichTextBox being in each one), that appear one above the other on a panel. The problem is that each control may have varying amounts of data, and so each RichTextBox (within each control) needs to size to fit the amount of text within that RichTextBox. I've tried multiplying the size of a single line...
4
4523
by: Tim Conner | last post by:
Hi, I am writing an application in C# that needs a memo control with the capability of highlight certain syntax of programming languages, very similar to what the Vs.Net does, or any language editor does. This should be the type of control that can accepts different inputs, since I need to display, VB, C# and SQL code, in nice highlighter colors. It won't compile or anything, so I don't need grammar checking, just the lexical tool.
1
2498
by: Nathan Carroll | last post by:
In an mdi environment I constructed a child for with a richtextbox control that is used to load .rtf's. This works fine on the intiatial load of the form but when for is closed and reopened later I get: System.ObjectDisposedException: Cannot access a disposed object named "RichTextBox". Object name: "RichTextBox". at System.Windows.Forms.Control.CreateHandle() at System.Windows.Forms.TextBoxBase.CreateHandle() at...
1
1684
by: tulasi | last post by:
I am placing textbox controls and combo box controls on richtext box and 2 command buttons on form control. after executing the application i'll place some text into textbox controls and select a value from combo box after entering of all the details i'll click on one of the command buttons then it will save the contents of the controls which i placed on the richtextbox into a file then i'll click on another command button so it will...
9
4878
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how can I print out this content to printer easily? Thanks! James
3
7191
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to just add plain (e.g.. rtf.Text += "new stuff..."; ) but some text, when added, I want to be in a different color or font size. Find() will not work because the text will vary. I have delimiters on it so I could recognize it with a regular ...
7
3473
by: =?ISO-8859-1?Q?Une_B=E9vue?= | last post by:
i'm in search of an online syntax highlighter able to highlight either JavaScript, CSS or HTMl only or a whole page. the result would be shown on the page itself, on demand. -- Une Bévue
2
3159
by: PJ6 | last post by:
Years ago I looked for a text editor control that would do automatic keyword highlighting, to no avail. I found sample code to roll my own, but all of that was crap (mostly because of the way the RichTextBox base class was written, and the limitations of GDI+). I ended up coming to conclusion that I'd have to write my own in C++ to make it work right, at which point I gave up. Now it seems there are controls out there that may do the trick...
4
13486
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a multiline RichTextBox that I use for data logging. I'm concerned about how the AppendText method reacts when over time the maximum number of characters have been added. Do the oldest characters it contains start rolling off the top into the bit bucket, does it simply start silently ignoring appends until some characters, are deleted, or does some kind of exception get thrown? I've heard numerous opinions on what the...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9954
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.