dbTalk Databases Forums  

Text and background color of selected items in listbox

comp.databases.ms-access comp.databases.ms-access


Discuss Text and background color of selected items in listbox in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
franc sutherland
 
Posts: n/a

Default Text and background color of selected items in listbox - 04-07-2010 , 06:30 PM






Is it possible to determine the text and background color for selected
items in a listbox, as it is with the unselected items? If you veer
away from the black on white, you can end up with some pretty
unreadable yellow on brown.
I saw that this question have been posted in 2006, and was replied to
in the negative. I was wondering if this had changed?

Many thanks,

Franc.

Reply With Quote
  #2  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Text and background color of selected items in listbox - 04-08-2010 , 10:02 AM






franc sutherland wrote:

Quote:
Is it possible to determine the text and background color for selected
items in a listbox, as it is with the unselected items? If you veer
away from the black on white, you can end up with some pretty
unreadable yellow on brown.
I saw that this question have been posted in 2006, and was replied to
in the negative. I was wondering if this had changed?
AFAIK, it hasn't changed.

You can figure out what the highlighted rows' colors will be
by taking the complement (change all the 1s to 0s and 0s to
1s) of the RGB value. This can be calculated in VBA by
using a statement like:
Me.List0.BackColor = Me.List0.ForeColor Xor &HFFFFFF

Unfortunatly, that doesn't mean much to the human eye unless
you stick with very basic colors. Eg. the complement of
blue is yellow, red is cyan, green is pink, etc. Black and
white start to make a lot more sense with this very limited
highlighting rule, but if you choose a backcolor that is the
complement of the forecolor some other combinations can look
acceptable..

--
Marsh

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.