--
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/9to4Xi4Ld3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wxpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi
I append my approach by using wx.EVT_KEY_DOWN and wx.EVT_KEY_UP but I also like to know if it’s possible to change the text color in the control to being sometimes black color and sometimes grey color.
You could use a wx.SearchCtrl with the SearchButton, CancelButton ect set to not be shown and use the method SetDescriptiveText for setting your default text.
The search control is a wx.TextCtrl with added functionality.
I would use EVT_SET_FOCUS and EVT_KILL_FOCUS.
By default on startup you'd set the color style of the TextCtrl to light-grey and set ChangeValue to the default text. Then in the EVT_SET_FOCUS handler, if the default text is shown ChangeValue('') and set the text style to the normal black color. In the EVT_KILL_FOCUS handler, if the GetValue() is '' (blank), set the light-grey text style and ChangeValue(defaultText).
-- Tim Roberts, ti...@probo.com Providenza & Boekelheide, Inc.