Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change a command button forecolor in a grid?
Message
De
22/11/2006 12:11:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
22/11/2006 10:50:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01171589
Message ID:
01171837
Vues:
9
>>hello
>>
>>how to change a command button forecolor in a grid based on a value in a table that populate the grid?
>>
>>Thanks
>
>
>o=createobject("frmColorButton")
>o.show
>o.addproperty("me",m.o)
>
>define class frmColorButton as form
>
>	add object grd as grid ;
>		with columncount=1
>
>	procedure init
>		create cursor zz (nColor i)
>		insert into zz values (0xffffff)
>		insert into zz values (0xffff7f)
>		insert into zz values (0xff7fff)
>		insert into zz values (0x7fffff)
>		insert into zz values (0x7f7fff)
>		insert into zz values (0xff7f7f)
>		insert into zz values (0x7fff7f)
>		locate
>		with this.grd
>			.recordsource="zz"
>			with .column1
>				.sparse=.f.
>				.removeobject(.controls[2].name)
>				.addobject("cmdColor", "cmdColor")
>				.cmdColor.visible=.t.
>				.dynamicfontshadow=[this.column1.cmdColor.refresh()]
>				.currentcontrol="cmdColor"
>			endwith
>		endwith
>
>	endproc
>
>	procedure destroy
>		clear events
>	endproc
>
>enddefine
>
>
>define class cmdColor as commandbutton
>	themes = .F.
>	fontbold = .T.
>	procedure refresh
>	
>		this.backcolor=nColor
>		this.Forecolor=BITXOR(nColor,0xF0F0F0)
>		this.Caption = STR(nColor)
>	endproc
>
>enddefine
>
Nice trick!

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform