473,395 Members | 1,675 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# rich text box color problem

1
I have a strange problem, i'm writing a syntax text editor in C#, it recognize reserved words and color them,
i'm also suupose to make auto indentation, but this causes me huge coloring problems, when writing: richTextBox1.Text+=" "; it effects on the text color and i was not able to over come this issue, check this code:
Expand|Select|Wrap|Line Numbers
  1. private void checkAndIndent()
  2. {
  3.             console.richTextBox1.Text+="\nNotice: (before indent) Active color is:"+richTextBox1.SelectionColor;
  4.             richTextBox1.Text+="    ";<<TAB INSERTION TO THE TEXT
  5.             richTextBox1.Select(richTextBox1.Text.Length+6,0);
  6.             console.richTextBox1.Text+="\nNotice: (after indent) Active color is:"+richTextBox1.SelectionColor;
  7.             richTextBox1.SelectionColor=textColor;
  8. }
  9.  
look at the console output:

Notice: (before indent) Active color is:Color [Black]
TextChanged: Event Fiering: :0:0
Event Arrived: wordColoring:False::0:0
Preforming last word black coloring
Notice: Active color is:Color [Black]
Notice: (after indent) Active color is:Color [Blue]

i have done nothing that changes the color in this section but still the color changes to blue
this happans only after at least one of the word was colored as the code recognized it as a reserved word

Sorry for broken english

IF YOU HAVE OTHER IDEA ON HOW TO IMPLEMENT AUTO INDENTATION INSTEAD OF ADDING THE TEXT A TAB IT WILL BE GREAT

PLEASE HELP it's a collage project i must finish it as soon as i can :(
Jun 14 '06 #1
0 1699

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tom_ZC | last post by:
I'm writing a find and replace routine for a text editor I'm working on. The editor has a rich text box on the main form (frmMain). The find/replace form is modeled after the one in Word '97/2K. ...
3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
5
by: Justin Kennedy | last post by:
Hi, I have a client that wants to format content in Word, paste it into a textarea, and have the html render exactly as it matches the Word doc. I've tried some scripts out there that offer...
1
by: Peter | last post by:
I have written a small terminal app that reads and writes to the serial port. In particular as the data is read from the serial port it is appended to the rich text box. The problem I am...
4
by: David Davis | last post by:
Woll2Woll has a product for Delphi called Infopower which has a rtf control with a built-in word processor. Does anyone know of a third party control that has the same capabilities. I don't have...
4
by: pbreah | last post by:
I'm doing a Rich Text Editor (WYSIWYG) in javascript for a game for kids. I'm doing a special case in with every keystroke from A-Z creates a background and foreground color for that letter, witch...
1
by: tomi.trescak | last post by:
Hi I have a problem with storing rich text in MySQL. I store rich text in MySQL (in column with type "text") which i get from Rich Textbox control. When i do reverse processing by trying to...
11
by: karen987 | last post by:
I have a web page which used to work fine until i added a rich text editor. the pages are in ASP and it is a news weblog, with a comments section where people click the headline of a comment and...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.