Click here to Skip to main content
13,292,376 members (63,099 online)
Click here to Skip to main content
Add your own
alternative version


39 bookmarked
Posted 28 Sep 2002

Prompting user for values from a CEdit

, 28 Sep 2002
Rate this:
Please Sign up or sign in to vote.
This article presents a special CEdit, that prompts the user for a value entry
<!-- Download Links --> <!-- Article image -->

Sample Image - PromptEdit.gif

<!-- Add the rest of your HTML here -->


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 the SetPromptShowMode(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 the SetRegainPrompt(bool). You can always check whether the prompt text is active by calling GetPromptTextActive(void). And of course there's SetPromptText(LPCTSTR) and another overloaded version that you can use to set the prompt text.


This article, along with any associated source code and files, is licensed under The BSD License


About the Author

Tanzim Husain
Web Developer
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

BugThere are some bugs Pin
llsaiya22-Mar-12 17:17
memberllsaiya22-Mar-12 17:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 29 Sep 2002
Article Copyright 2002 by Tanzim Husain
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid