Solved

Help!!! How to know whether the user has finished writing in edit box?

Posted on 2000-02-25
6
189 Views
Last Modified: 2013-11-20
Hi,

I want the user to enter the name of a file in an edit box, my qn is:

1. how to know the user has finished writing?
2. how to know if the user did not write anything? (for error checking purpose)

Pls help!

Thanks a lot!
0
Comment
Question by:greenbird
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2560381
1) When the control looses focus (because he has tabbed/moved out to another control, or pressed enter)

2) see if the test is empty.
0
 
LVL 3

Expert Comment

by:akalmani
ID: 2560384
Hi
  Hook a message hanlder for edit box i.e OnKillFocus() , Do all the things there. U can get to know whether the user typed anything or not
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2560394
Best to use DDX_Text to associate a CString member var with the control.  Then add an ON_EN_KILLFOCUS (which would call, say, OnKillfocusEditbox) to the message map.

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:greenbird
ID: 2560423
Hi, all,

could u pls illustrate more? i am new to VC++, so can not get it, could u pls provide some examples?
such as, the code written in the functions etc.

thanks a lot!
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 10 total points
ID: 2560442
I assume you have a dialog with an edit box in it.

Go to the dialog edit.

Ctrl+Double Click on the edit control to add a member variable of type CString.

Ctrl+W to bring up the Class Wizard.

Select the ID for your edit control.  Select the kill focus message from the list and add a handler for it, push the edit code button to take you to the code.

This function will be called when the user has finished typing in the control .  Do whatever you want there.  In particular you can look at the CString member variable you created above to see if it is empty (.IsEmpty() function).

That should do it.

If you have problems, try some of the tutorials (like Scribble) that take you through these steps.

Or come back here for some more help.
0
 

Author Comment

by:greenbird
ID: 2560571
Hi,

thanks , i will try it later :)

wish u a happy weekend.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now