Print Page | Close Window

[SOLVED] Colour Picker Control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=17406
Printed Date: 23 November 2024 at 2:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Colour Picker Control
Posted By: Hemesh
Subject: [SOLVED] Colour Picker Control
Date Posted: 12 October 2010 at 3:28am
Is there a way to get the font colour on the colour picker? I like the fact that it picks up the appropriate font colour automatically depending on what colour is picked :)

Clap


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0



Replies:
Posted By: Hemesh
Date Posted: 12 October 2010 at 5:52am
Alternatively... If anyone knows the correct colour number to switch from Black to White, then that'd be just as good :)

-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 16 October 2010 at 3:11am
Hi,
 
I don't understand your first post... and maybe second either... Wink
 
Black = 0
White = 16777215
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Hemesh
Date Posted: 21 October 2010 at 11:12am
D'OH, didn't have email notification on...

The CJ Colour picker will change the font colour from black to white when it's a certain darkness of colour. I want to essentially grab the font colour from the picker to use elsewhere but as I can't see how to do that, I think it might be something based on a certain darkness of colour before it changes the font from black to white, and that's what I'm after :)

... unless we can grab the font colour from the colour picker? :D


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 21 October 2010 at 1:54pm
Hi,
 
OK, now I know what you mean LOL
 
I don't see how to get the ForeColor from the ColorPicker control. The font object isn't returning color either. Maybe CJ can shed a light on this Wink Would be nice though if a label or text automatically changes the forecolor when selecting a dark color from ColorPicker.
 
Good luck !
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Hemesh
Date Posted: 22 October 2010 at 3:33am
Worked it out now as I got put under pressure to sort it out! Kind of obvious now I think about it LOL..

Private Function Get_ForeColour(ByVal lngBackColour As Long) As Long
    If lngBackColour > RGB(128, 128, 128) Then
        Get_ForeColour = vbBlack
    Else
        Get_ForeColour = vbWhite
    End If
End Function


Would be easier to just grab it from the control though... Wink... put in the option CJ :)


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 22 October 2010 at 4:04am
Hi,
 
It sounded almost to good to be true Wink
 
Try to pick some light green color...
 
 
 
Foreground will be white but the ColorPicker foreground is still black (as it should be)
 
But in most cases, you are right Wink
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Hemesh
Date Posted: 22 October 2010 at 4:06am
D'oh! I knew there'd be somewhere.... come on CJ, show us what the magic number is! Thumbs Up

-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net