Color CheckBox << Back



Most of you are using Common Control 6.0, that means your program has a corresponding manifest file within the same folder. One of the things about Common Control 6.0 is that Microsoft has taken some of the customizations abilities away from the programmers. Things that used to work might not work now. For example, setting the text color of a CheckBox used to be pretty easy.

Object oCheckBox is a CheckBox
	Set TextColor to clGreen
End_Object

But since the introduction of Common Control 6.0, the TextColor property in CheckBox is useless because Microsoft has introduced theming to all Common Controls 6.0 version. The easiest way to workaround the problem is to tell Common Control NOT to theme the CheckBox.

Use DfAllEnt
External_Function SetWindowTheme "SetWindowTheme" UXTHEME.DLL Handle h Integer i1 Integer i2 Returns Integer
Object oMain is a Panel
	Object oCheck is a CheckBox
		Set Size to 10 50
		Set TextColor to clRed
		Set Color to clGreen
		Set Label to "Test"
		Procedure Page_Object Integer iPage
			Integer ia iz
			Forward Send Page_Object iPage
			Move 0 to iz
			Move (AddressOf(iz)) to ia
			Move (SetWindowTheme(Form_Window_Handle(Self,0),ia,ia)) to iPage
		End_Procedure // Page_Object
	End_Object // oCheck
End_Object // oMain
Start_UI
Free Web Hosting