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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. a problem about "OnLButtonDblClk "

a problem about "OnLButtonDblClk "

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 2 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.
  • B Offline
    B Offline
    benben
    wrote on last edited by
    #1

    In my program, I create a controlbar . If I double click on the controlbar, it can get the LButtonDblClk message. Then I create an rebar on that controlbar, but if I double click on the rebar, the controlbar can't get the LButtonDblClk message. And I find if I right click on the rebar, the controlbar still can get the right-click message. It is strange.How could I get the LButtonDblClk message in the controlbar when I doubld click on the rebar? Thanks Benben

    T 1 Reply Last reply
    0
    • B benben

      In my program, I create a controlbar . If I double click on the controlbar, it can get the LButtonDblClk message. Then I create an rebar on that controlbar, but if I double click on the rebar, the controlbar can't get the LButtonDblClk message. And I find if I right click on the rebar, the controlbar still can get the right-click message. It is strange.How could I get the LButtonDblClk message in the controlbar when I doubld click on the rebar? Thanks Benben

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      are you sure it is the right control that is handling the message ? (be sure it is the child class tha is doing so)


      TOXCCT >>> GEII power

      B 1 Reply Last reply
      0
      • T toxcct

        are you sure it is the right control that is handling the message ? (be sure it is the child class tha is doing so)


        TOXCCT >>> GEII power

        B Offline
        B Offline
        benben
        wrote on last edited by
        #3

        Yes,I don't think it is a right control. But what I mean is I want to do something when the user double click on the controlbar( include the area covered by the rebar), how should I do?(And I am sure the rebar needn't process this message).And it really work for right click message. Thanks Benben

        T 1 Reply Last reply
        0
        • B benben

          Yes,I don't think it is a right control. But what I mean is I want to do something when the user double click on the controlbar( include the area covered by the rebar), how should I do?(And I am sure the rebar needn't process this message).And it really work for right click message. Thanks Benben

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          // Where is the mouse?
          CPoint p(GetMessagePos());
          ScreenToClient(&p);

          // Get the bounds of the control (just the client area)
          CRect rect;
          GetClientRect(rect);

          // Check the mouse is inside the control
          if (rect.PtInRect(p)) {
          // Do what you need here...

          // ...and perhaps redraw the control...
          Invalidate();
          }


          TOXCCT >>> GEII power

          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