The confusion arises because GETCOLOR() returns a 24-bit value, and (2^24) = 1 = 16777215. On that basis, -1 is the same as white. So, you can explicitly set, say, _SCREEN.Backcolor to -1, and it will appear as white. But this isn't really a problem, as you will always explicitly test for -1 to see if GETCOLOR() was cancelled.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
If you want to want to prevent them selecting white in the first place (rather than displaying a message to say it's an illegal value), you could create your own custom colour picker. Make it an ordinary VFP modal form, with a shape for each permitted colour, and a pair of buttons for OK and Cancel. When the user clicks on one of the shapes, save the corresponding numeric code in a form property, and then return that value when the form is closed.
You might well decide that's too much trouble, and also that it would have the disadvantage of a non-standard appearance. But it might be better than the alternative, that is, permitting the user to make a choice and then turning round and saying that the choice is illegal - which is a UI no-no, in my humble o.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.