|
-
April 25th, 2004, 12:29 AM
#1
Unable to display List Box
Help, please....
I am a newbie in C++. In an MFC dialog, I put an Edit control and a List box. I want to populate the List box (m_List) with strings derived from the Edit box string.
- in the dialog's OnInitDialog, I tried to put
GetDlgItemText (..) // get text from Edit box
process the string //
m_List.AddString (..) // etc. several strings
m_List.SetCurSel (..) //
but GetDlgItemText could not work from OnInitDialog.
- When I put the above code in OnOK, the ListBox is populated for a fraction of seconds and soon disappear.
I have read the MSDN library, and tried other events (OnKillFocus, etc.) but could not get the dialog to stop to display the strings in the List Box. What should I do ? ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|