How to obtain the string written in the Edit box of a Combo box
Can somebody please tell how I can obtain the string written in the Edit box of a combo box??
Zulfi
Re: How to obtain the string written in the Edit box of a Combo box
There are a lot of methods for this. Let's anonce only one:
Add a memeber of CEdit type to your edit control. Let's say m_myEdit.
When you want to read the text use this :
CString strName;
m_myEdit.GetWindowText(strName);
Let me know if this helps you.
best regards,
Faby
Re: How to obtain the string written in the Edit box of a Combo box
Try this:
CString szText;
yourDlg.GetDlgItemText(ID_FOR_YOUR_COMBO, szText)
Petrut Isan <[email protected]>
Re: How to obtain the string written in the Edit box of a Combo box
Thanks for your help. Actually it was the Edit box of Combo. So I used Class Wizard to create onEditChange function & the I put the following code
GetDlgItem(IDC_FILT_SUB1, szText);
The text box contents were stored in szText.
Thanks.
Zulfi
Re: How to obtain the string written in the Edit box of a Combo box
Thanks for your help. It worked. I put your code in OnEditChange method which is brought into action if something happens in Edit box. It worked fine.
Zulfi.