Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetColor
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00700557
Message ID:
00700560
Views:
76
This message has been marked as the solution to the initial question of the thread.
You can use Common Dialog Control.
oDlg = Createobject("GetColorEx")
? oDlg.Getcolor(255)

DEFINE CLASS GetColorEx AS form
	Left = 100   && Set Dialog Position by positioning the form
	Top = 100    && Set Dialog Position
	Name = "GetColorEx"
	DoCreate = .T.
	Visible = .F.
	lUserCancel = .F.
	
	ADD OBJECT oCDC AS OleControl WITH ;
		OleClass = "MsComDlg.CommonDialog"

	PROCEDURE oCDC.Init
		This.Flags = 2+1
		This.CancelError = .T. 	
	ENDPROC 	

	PROCEDURE Error
		LPARAMETERS nError, cMethod, nLine
		IF nError = 1429
			This.lUserCancel = .T.
		ENDIF
	ENDPROC 	
	
	PROCEDURE GetColor(tnInitColor)
                LOCAL lnColor 
		IF PCOUNT() > 0
			Thisform.oCDC.Color = tnInitColor
		ENDIF
		Thisform.oCDC.ShowColor()
		IF Thisform.lUserCancel 
			lnColor = -1
		ELSE	
			lnColor = Thisform.oCDC.Color		
		ENDIF
		RETURN lnColor 
	ENDPROC 	
	
ENDDEFINE	
>Hi All,
>
>I'm allowing my users to change some background colors in an application, I'm using the GetColor() function and everything works well. But...
>
>What I want is to display the color picker window with the "Define custom colors" button clicked so it shows the whole palette of colors available.
>Is that possible?
>I attempted using the keyboard command but it is klugdy and won't work in all cases.
>Is there in Windows or another color picker available?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform