Solved

MFC C++ edit box issue

Posted on 2009-05-11
3
815 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Setup project 6 73
Decompiler for vb and vb.net - Visual Studio community edition 9 82
Capture logon name 13 73
eclipse apache tomcat admin console 52 97
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

803 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