Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Question about CComboBoxEx

Question about CComboBoxEx

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dssuresh
    wrote on last edited by
    #1

    Hi ALL, I have overriden the OnSetFocus() for CComboBoxEx control by trapping the WM_SETFOCUS event. This event gets fired only when i tab to that control from another control. This function does not get invoked when i click on the ComboBoxEx control using the mouse. I have some edit controls also on the same dialog and the setfocus event gets fired when i click those controls. Any ideas why the CComboBox is not working? thanks, Suresh

    A 1 Reply Last reply
    0
    • D dssuresh

      Hi ALL, I have overriden the OnSetFocus() for CComboBoxEx control by trapping the WM_SETFOCUS event. This event gets fired only when i tab to that control from another control. This function does not get invoked when i click on the ComboBoxEx control using the mouse. I have some edit controls also on the same dialog and the setfocus event gets fired when i click those controls. Any ideas why the CComboBox is not working? thanks, Suresh

      A Offline
      A Offline
      asierra
      wrote on last edited by
      #2

      It works for me, In your combo properties, what type you have specified. DropDown, Simple, DropList. Have you tried that? Best, -Alfredo

      D 1 Reply Last reply
      0
      • A asierra

        It works for me, In your combo properties, what type you have specified. DropDown, Simple, DropList. Have you tried that? Best, -Alfredo

        D Offline
        D Offline
        dssuresh
        wrote on last edited by
        #3

        Alfredo, Thanks a bunch for your response. I have already tried all the three properties, but unfortunately it does not work. Are you using CComboBox or CComboBoxEx?. I tried using CComboBox instead of CComboBox and it does work. Please let me know your comments and thanks again for your help. Suresh

        A 2 Replies Last reply
        0
        • D dssuresh

          Alfredo, Thanks a bunch for your response. I have already tried all the three properties, but unfortunately it does not work. Are you using CComboBox or CComboBoxEx?. I tried using CComboBox instead of CComboBox and it does work. Please let me know your comments and thanks again for your help. Suresh

          A Offline
          A Offline
          asierra
          wrote on last edited by
          #4

          You're right I was using CComboBox not CComboBoxEx. But I am trying to look for another application using CComboBoxEx, let me do some tests and I'll get back to you. Best, Alfredo

          1 Reply Last reply
          0
          • D dssuresh

            Alfredo, Thanks a bunch for your response. I have already tried all the three properties, but unfortunately it does not work. Are you using CComboBox or CComboBoxEx?. I tried using CComboBox instead of CComboBox and it does work. Please let me know your comments and thanks again for your help. Suresh

            A Offline
            A Offline
            asierra
            wrote on last edited by
            #5

            Suresh, I just created a CComboBoxEx into my project (Dragging the ctrl into my form), went to class wizard and added the function for the SETFOCUS handle event, placed a MessageBox("Got the Focus", NULL, MB_OK) and it worked as expected. How are you creating your control? Have you tried doing exactly the same thing I just did? Visual C++ 6.0 right? Are you creating a class for you control? I suggest you to try to do the same thing I did in another project to see if it works. Good Luck Best, Alfredo

            A 1 Reply Last reply
            0
            • A asierra

              Suresh, I just created a CComboBoxEx into my project (Dragging the ctrl into my form), went to class wizard and added the function for the SETFOCUS handle event, placed a MessageBox("Got the Focus", NULL, MB_OK) and it worked as expected. How are you creating your control? Have you tried doing exactly the same thing I just did? Visual C++ 6.0 right? Are you creating a class for you control? I suggest you to try to do the same thing I did in another project to see if it works. Good Luck Best, Alfredo

              A Offline
              A Offline
              Anonymous
              wrote on last edited by
              #6

              Alfredo, Thanks a lot for your help on this regard. I got it working by trapping the CBN_SETFOCUS event. Thanks again for your help. LRESULT CConfigCmbFieldWnd::WindowProc( UINT message, WPARAM wParam, LPARAM lParam ) { // Trap the if ( CBN_SETFOCUS == HIWORD( wParam ) ) { CTraceConfigPage* pTraceConfigPage = DYNAMIC_DOWNCAST(CTraceConfigPage, GetParent()); ASSERT( NULL != pTraceConfigPage ); // assign the current control ID pTraceConfigPage->SetFieldCtrlID(m_iFieldCtrlID); } return CComboBoxEx::WindowProc( message, wParam, lParam) ; }

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups