
Introduction
I got the idea for this control after looking at some website, where the text boxes in forms contained tagged text like <enter your name here>, that went away once the text box got input focus. I thought that was a great idea, and here's my MFC version of the same thing. You can set different colors to the prompt text my setting theSetPromptShowMode(PromptShowModeEnum)
member. You can also control whether the prompt text will go away one the user has left the edit control without entering any value or not by setting theSetRegainPrompt(bool)
. You can always check whether the prompt text is active by callingGetPromptTextActive(void)
. And of course there'sSetPromptText(LPCTSTR)
and another overloaded version that you can use to set the prompt text.