?
Solved

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

Posted on 2000-02-25
6
Medium Priority
?
200 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 40 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

839 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