Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Make font color light if background color is dark
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Make font color light if background color is dark

 Post Reply Post Reply
Author
Message
DataFlowJoe View Drop Down
Groupie
Groupie


Joined: 30 October 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote DataFlowJoe Quote  Post ReplyReply Direct Link To This Post Topic: Make font color light if background color is dark
    Posted: 14 May 2009 at 10:49am
Hi guys...
 
Is it possible to change the font colour of the calendar events so that the text appears lighter if the label background colour is dark.
 
Ideally I'd like the foreground colour to change to a lighter colour if the background is too dark to support black text. 
 
Thanks in advance
He is no fool who gives what he cannot keep to gain what he cannot lose. (Jim Elliott)
Back to Top
DataFlowJoe View Drop Down
Groupie
Groupie


Joined: 30 October 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote DataFlowJoe Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2009 at 6:37pm
Hi Guys,
 
I've found out from another forum how to get the inverse color to enable contrast with darker backgrounds ... in VB it's done using the following code...
 
Function GetContrastColor(lngParamColor ) As Long

    GetContrastColor = Not lngParamColor And &HFFFFFF

End Function
 
I now want to implement this but I can't get the BeforeDrawThemeObject event to trigger. I've set it to fire for all flags but it's not getting fired ...
 
 
I guess I need to use this event to change the text color to contrast whatever colour the Event background has been set to.
 
Any help will be greatly appreciated.
 
Thanks
He is no fool who gives what he cannot keep to gain what he cannot lose. (Jim Elliott)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.