View Full Version : CheckBox Help Again!
abnrange
10-20-2009, 02:15 PM
1. If box checked change label color red and run script
2. If not checked undo and change color to blue
I want to have multiple checkbox and was trying to find any easy way to do the color change globally.
Global code and checkbox code.
I got this to work except once checked it goes to disabled. Not sure why! Can someone tell me what I did wrong? Thanks
longedge
10-21-2009, 02:09 AM
There's some quick and dirty example stuff in there that I recognise :)
Change the global function code to -
function toggle()
tProperties = CheckBox.GetProperties("CheckBox"..x);
if tProperties.Checked == true then
tProperties.ColorNormal = Math.HexColorToNumber("FF0000");
else
tProperties.ColorNormal = Math.HexColorToNumber("0000FF");
end
CheckBox.SetProperties("CheckBox"..x, tProperties);
end
It's really important to look through code and fully understand what and how each line does what it does - the function was setting the checkbox disabled.
abnrange
10-21-2009, 07:03 AM
Thanks that works with a small problem. When you mouse over the text, it changes colors. Why is that and how can we fix? Thanks again
longedge
10-21-2009, 07:43 AM
Yes - look at the properties of the checkbox. The highlight colour is set there. The code I posted earlier only deals with the colour for the normal state.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.