0

I have a few TEdits on my form. When created they have default text in a gray font color. (e.g. "Surname" and "Name") See example below:

enter image description here

Their on click events causes the default text to be cleared and their font color to be set to black.

enter image description here

My Problem: When I use the tab key to switch between the TEdits the onClick event will not triggered so the TEdit will not be cleared and the font color will stay grey.

Any suggestions on how I can fix this will be appreciated!

Craig
  • 548
  • 9
  • 24
  • 2
    Check the onEnter event. – Tim3880 Jun 11 '15 at 19:30
  • Thanks Man! That worked! Don't know why I din't try that. – Craig Jun 11 '15 at 19:42
  • 1
    On Windows XP and later, you don't need to manage the text manually like this if you have CommCtrl v6 Visual Styles enabled in your app. You can use the [`EM_SETCUEBANNER`](https://msdn.microsoft.com/en-us/library/windows/desktop/bb761639.aspx) message instead and let Windows handle everything for you. – Remy Lebeau Jun 11 '15 at 20:33

0 Answers0