473,324 Members | 1,678 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,324 software developers and data experts.

RichTextBox Colors

When I append data to my richtextbox I use selectioncolor to set the color of that block of text. The problem with this, is if the user is selecting as well.


If my sub is called, the following executes:

with myrichtextbox
.selectioncolor = mycolor
.appendtext(mytext)
end with


So you see the problem is if the sub is called while the user is also selecting text, mycolor is applied to the user's selected text instead of mytext. Any suggestions?
Sep 22 '07 #1
2 896
QVeen72
1,445 Expert 1GB
Hi,

Keep FormLevel Variables For the Selection which u do from Code. Pass the variables to the Procedure, and In Procedure, Remove any Previously Selcted Text and Again Re-Select That Part of Text (Passed thru parameter) and Apply Colors.

REgards
Veena
Sep 22 '07 #2
Thanks, you were very helpful in solving this problem!
Sep 22 '07 #3

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

Similar topics

3
by: AttiDude | last post by:
Hi, I have some difficulties when adding text to a (multiline)richtextbox, to change the color of that line only. Changing colors on parts of text you want, need to be selected to change color. So...
7
by: Scott | last post by:
I need to have a RichTextBox that displays various text (in color), but the user cannot highlight or edit the text in anyway, With a regular textbox, I can set .Enabled=False and that does exactly...
2
by: RobKinney1 | last post by:
Hello and thank you for reading this post. I have a RichTextBox. I need to select text inside for a search feature. Easy enough... right? Well apparently from the .NET help and everything from...
2
by: Ludwig | last post by:
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...
1
by: iwdu15 | last post by:
hi, im trying to figure out how to get all the font and color selections of a richt text box. for instance we could have this: Red (formatted in red color and Arial font) Green (formatted in...
1
by: gazelle04 | last post by:
I'm trying to use the "RichTextBox" control so that I can have a text box where you can format the selected text's font, size, and colors but when I insert that Active X control it gives an error...
1
by: plonk | last post by:
Hi I'm having a small problem with a vb.net application (Visual Studio 2005) I'm trying to insert the contents of a Richtextbox.text into the body of an email. It all works fine, except when I...
1
by: roucha | last post by:
I have created a chat program, and i want the usernames to be a different color then the other words in the richtextbox that i have. i have googled this and i did not find any suitable answer....
4
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...
0
by: pzero24 | last post by:
I am trying to add a color table to the RTF of my RichTextBox control when I instantiate the control. The problem is that the color table will not stay there. The only time it stays is if I have text...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.