473,397 Members | 2,099 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,397 software developers and data experts.

changing the background color of Selected Text in an RTB

Hey!

One quick question: It's really easy to change the background color of
an entire RTB, but I have looked and looked and can't find a way to
change the background color of the selected text in an RTB. Anyone
know how?

Any help is greatly appreciated!!!

Sep 22 '06 #1
3 2071
Hi,

RichTextBox has a property SelectionBackColor that will change the
background color of the selected text. I think this is what you are after.
--
HTH
Stoitcho Goutsev (100)

"njuneardave" <da**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hey!

One quick question: It's really easy to change the background color of
an entire RTB, but I have looked and looked and can't find a way to
change the background color of the selected text in an RTB. Anyone
know how?

Any help is greatly appreciated!!!

Sep 22 '06 #2
Stoitcho,

Thanks for the answer, but unfortunately, I forgot to mention that I am
using .NET 2003, and I do not see this option. Any other advice?
Thanks again!

Stoitcho Goutsev (100) wrote:
Hi,

RichTextBox has a property SelectionBackColor that will change the
background color of the selected text. I think this is what you are after.
--
HTH
Stoitcho Goutsev (100)

"njuneardave" <da**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hey!

One quick question: It's really easy to change the background color of
an entire RTB, but I have looked and looked and can't find a way to
change the background color of the selected text in an RTB. Anyone
know how?

Any help is greatly appreciated!!!
Sep 25 '06 #3
Yes, this is unfortunate. In this case you have no other option but to use
PInvoke and send EM_SETCHARFORMAT message to the RichEditBox using
CHARTFROMAT2 structure; this structure has crBackColorField.
--
HTH
Stoitcho Goutsev (100)

"njuneardave" <da**********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Stoitcho,

Thanks for the answer, but unfortunately, I forgot to mention that I am
using .NET 2003, and I do not see this option. Any other advice?
Thanks again!

Stoitcho Goutsev (100) wrote:
>Hi,

RichTextBox has a property SelectionBackColor that will change the
background color of the selected text. I think this is what you are
after.
--
HTH
Stoitcho Goutsev (100)

"njuneardave" <da**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...
Hey!

One quick question: It's really easy to change the background color of
an entire RTB, but I have looked and looked and can't find a way to
change the background color of the selected text in an RTB. Anyone
know how?

Any help is greatly appreciated!!!

Sep 25 '06 #4

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

Similar topics

1
by: P.Singh | last post by:
hi all i am designing a website for a charity origanisation. they cater towards the senior crowd. i would like to have choice by which the user can change the background as required (like...
31
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
4
by: Chris Mahoney | last post by:
Hi Currently I am setting the background image of my page by using the following code: <style type="text/css"> BODY { BACKGROUND-IMAGE: url(myimage.jpg) } </style> What I would like to do...
8
by: johkar | last post by:
I have two problems I cannot work out in the following tab code with Netscape 6. Problems are marked with all cap comments. One is that the background image is not shown in NS 6 (two places in...
2
by: frank.sconzo | last post by:
Greetings, I was testing my web application on the Mac/Safari and noticed a problem with the background color of the select input element. Safari doesn't seem to pay any attention to the style I...
8
by: Bosconian | last post by:
I have two multiple select inputs. Initially the first contains a bunch of items and the second is empty. Using a common method, I move items back and forth by double clicking on them. This...
9
by: frizzle | last post by:
Hi there, I have a site where i display all kinds of thumbnails, (all 100 * 100px), the thumbs are links (surprise! ;) ). They link to a page where someone can order the picture. If ordered, a...
5
by: jeddiki | last post by:
I want to change the default background color of my select box. Here is the problem: Link to form with color select Notice in the color selector, the background color that I have given it it...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.