CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    How to detect that someone has pressed ENTER on listbox or CEditview both?

    Hello I just wann know that how this is possible to know that some one has pressed eneter button after writing some text in :

    CEditView and Textbox...


    Suggest

    Thanking you

    Sandeep
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  2. #2
    Join Date
    Jun 2005
    Posts
    14

    Re: How to detect that someone has pressed ENTER on listbox or CEditview both?

    You should be able to handle the WM_CHAR (OnChar) event and check for enter.

    Phil

  3. #3
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: How to detect that someone has pressed ENTER on listbox or CEditview both?

    Hi thanks,

    I am just curious to know that I am having three views i.e. CMyView, CListView and CEditView.
    Now i am adding text to CEditview. So where should I add WM_CHAR handler. As I am not doing any thing with my CMyView..

    Suggest..
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  4. #4
    Join Date
    Jun 2005
    Posts
    14

    Re: How to detect that someone has pressed ENTER on listbox or CEditview both?

    Whatever control has focus and is being typed in will be the control class that you want to detect WM_CHAR. If you want to detect the enter key from multiple controls, you will need multiple handlers for each control class.

    Phil

  5. #5
    Join Date
    Feb 2000
    Location
    Indore, India
    Posts
    1,046

    Re: How to detect that someone has pressed ENTER on listbox or CEditview both?

    Hello,

    Depending on what you want to get, there are different methodologies. If you want to know whether selection is changed or data modified in the listbox/combobox, you can sabe the previous selection / data in memory and check whether they are changed.

    Regards.
    Pravin.
    17-07-2005.

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