CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 1999
    Location
    Pakistan
    Posts
    207

    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


  2. #2
    Join Date
    Jun 1999
    Posts
    319

    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


  3. #3
    Join Date
    Jun 1999
    Posts
    13

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

  4. #4
    Join Date
    Apr 1999
    Location
    Pakistan
    Posts
    207

    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


  5. #5
    Join Date
    Apr 1999
    Location
    Pakistan
    Posts
    207

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured