Solved

MFC C++ edit box issue

Posted on 2009-05-11
3
827 Views
Last Modified: 2013-12-14
I have an EditBox I use to collect data that is then moved to ListBox. I declared the variable for the edit box as type CString. This is how I move the text...

strText = m_txtListbox;
m_ctlListBox.AddString(strText);

 My problem is that I can't seem to clear the editbox after the text is moved to the ListBox. I tried this...

m_txtListbox.Delete(0,m_txtListbox.GetLength());

and this...

m_txtListbox.Empty();

Neither one removes the text from the text box. SO, how do I remove the text from the EditBox?


Thank you,

Alan
0
Comment
Question by:kingofnines
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 250 total points
ID: 24355967
Hi kingofnines,

to do so you'll have to use UpdateData, i.e.:

> UpdateData( TRUE );
> ...
> m_txtListbox = "";
> UpdateData( FALSE );

Hope that helps,

ZOPPO
0
 
LVL 5

Author Comment

by:kingofnines
ID: 24356053
Well, dont I feel silly. Thank you Zoppo!

Alan
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 24359029
:o)

No problem, you're welcome - I'm glad I could help ...

Have a nice day,

best regards,

ZOPPO
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sumHeights  challenge 17 83
Change to event 1 138
oracle 11g 23 150
Adjust the codes 3 63
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

734 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