Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Koen Piller
  Where is Koen Piller?
 Santpoort
 Netherlands
 Koen Piller
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Change of Color of Check box tick
Thread ID: 289050 Message ID: 289117 # Views: 86 # Ratings: 0
Version: Visual FoxPro 9 Category: Projects and Design
Date: Tuesday, December 28, 2010 1:49:54 PM         
   


> Q. How can we change the Check box tick color from black to any ? like yahoo mail in which tick color is green


Hi,
to change the color of the checkbox tick is explained by Yousfi ,however this does not work for Win7 - at least I could not get it to work. This is in XP and earlier the checkboxtick are solid color - MS changed in Win7 and maybe also in Vista to a gradient checkbox tick style - which makes things complicate to replace the colours

Please study Yousfi's coding here:
*!*--Author Yousfi Benameur El Bayadh Algeria
*!*--Time stamp samedi 21 août 2010; 17:36:11
*!*--Subject :change tick checkbox color graphically (warning not permanent).
*!*--Thread ID:  	274754  	 Message ID:  	 274842 
*!*--Version Vfp9Sp2

*!*--Begin Code

yform=createObject("asup")
yform.show(1)
return

DEFINE CLASS asup AS form
	Top = 104
	Left = 133
	Height = 92
	Width = 150
	BorderStyle = 0
	Caption = ""
	HalfHeightCaption = .T.
	MaxButton = .F.
	Name = "form1"

	ADD OBJECT check1 AS checkbox WITH ;
		Top = 12, ;
		Left = 24, ;
		Height = 24, ;
		Width = 84, ;
		Alignment = 0, ;
		BackStyle = 0, ;
		Caption = "Check1", ;
		Value = 1, ;
		Style = 0, ;
		Name = "Check1"

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 44, ;
		Left = 12, ;
		Height = 27, ;
		Width = 120, ;
		Caption = "Change tick color", ;
		Name = "Command2"

	PROCEDURE command2.Click
		thisform.check1.value=1

		xcolor=getcolor()
		if empty(xcolor)
		return .f.
		endi
		thisform.cls

		l=thisform.check1.left
		t=thisform.check1.top
		for i=l to l+17  &&just the checkbox square
		for j=t to t+17
		if thisform.point(i,j)=rgb(33,161,33)  &&original windows xp color of tick
		thisform.forecolor=xcolor
		thisform.pset(i,j)
		endi
		endfor
		endfor
	ENDPROC


ENDDEFINE
*!*End Code


So if you found a way to make use of this coding to change the color also in Win7 please let us know.

Regards,

Koen

ENTIRE THREAD

Change of Color of Check box tick Posted by Khurram Tahir @ 12/28/2010 6:51:01 AM
RE: Change of Color of Check box tick Posted by Samir H. @ 12/28/2010 8:39:36 AM
RE: Change of Color of Check box tick Posted by Koen Piller @ 12/28/2010 1:49:54 PM
RE: Change of Color of Check box tick Posted by Jignesh Parekh @ 12/28/2010 2:39:46 PM
RE: Change of Color of Check box tick Posted by Mike Potjer @ 1/4/2011 6:50:12 PM
RE: Change of Color of Check box tick Posted by Christian Tabligan @ 1/5/2011 7:20:22 AM
RE: Change of Color of Check box tick Posted by Koen Piller @ 1/5/2011 12:08:22 PM
RE: Change of Color of Check box tick Posted by Christian Tabligan @ 1/5/2011 3:59:56 PM
RE: Change of Color of Check box tick Posted by Koen Piller @ 1/5/2011 5:07:42 PM
RE: Change of Color of Check box tick Posted by Mike Gagnon @ 1/5/2011 9:14:55 PM
RE: Change of Color of Check box tick Posted by Yousfi Benameur @ 1/6/2011 12:40:52 AM
RE: Change of Color of Check box tick Posted by Koen Piller @ 1/6/2011 7:27:32 PM
RE: Change of Color of Check box tick Posted by Yousfi Benameur @ 1/6/2011 9:44:05 PM
RE: Change of Color of Check box tick Posted by Koen Piller @ 1/7/2011 8:33:57 PM
RE: Change of Color of Check box tick Posted by Yousfi Benameur @ 1/7/2011 10:13:41 PM
RE: Change of Color of Check box tick Posted by Koen Piller @ 1/9/2011 12:15:10 AM
RE: Change of Color of Check box tick Posted by Yousfi Benameur @ 1/9/2011 3:04:39 PM
RE: Change of Color of Check box tick Posted by Koen Piller @ 1/9/2011 9:25:02 PM
RE: Change of Color of Check box tick Posted by Ony Too @ 1/10/2011 9:17:28 PM