How to set txtbox color to default when user starts typing?

If I have notified the user to fill a particular textbox by changing its background color then when the user starts typing how do I change background color to default value ( couldnt find Default in Colors palette )

simply do this:
When textbox1.GotFocus
set textbox1.backGroundColor to [put here the default color]
When textbox1.LostFocus
set textbox1.backGroundColor to [put here the not default color]

2 Likes

The default colour is set by you in the Properties Palette or via Blocks.

1 Like

Can you please show code/Blocks on how to actually choose 'Default' as a color , i am really lost here , In the Blocks - Built in - Colors : there is no 'Default' option

Default for textboxes bg is white and for text is black. Use the white and black blocks.

1 Like

Either of these will set the textbox back to its default colour:

image

(works for other components too, e.g. button, label etc.

3 Likes

If you do not set the colours, the default is black on white, though we have had some unusual experiences such as white on white.

So the Option for default is that you set colours you require, or leave it as is.

Thanks for the reply , but maybe i was not clear enough the first time ,as textbox1.gotfocus is an Event , I dont know if i can really use it inside a procedure :

What I am trying to do : I have 7 fields for the user to fill and a 'Next button' , when the user clicks Next Button , if any of the fields are empty , he/she is notified (using notifier) by changing color of empty boxes , now when the user starts writing within the box , the color should disappear i don't want to pester them with the colors - any suggesstions on how do i do it
Also I need to do this when this highlight_textbox procedure is called

Set up a Clock timer to check if there is a Text Box with focus and if there is, change the Background Colour.

I believe this will do what you want?

tbfocus.aia (2.5 KB)

1 Like