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. Managed C++/CLI
  4. Finding the menu item the mouse is over for help request [modified]

Finding the menu item the mouse is over for help request [modified]

Scheduled Pinned Locked Moved Managed C++/CLI
htmlhelp
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.
  • E Offline
    E Offline
    earlgraham
    wrote on last edited by
    #1

    I want to have my compiled html help point to a topic specific to where the mouse is pointing but I can't seem to determine which control the mouse is hovering over.

    private: System::Void FrmMain_HelpRequested(System::Object^  sender, System::Windows::Forms::HelpEventArgs^  hlpevent) 
    {
      Point pt = this->PointToClient(hlpevent->MousePos);
      Control^ requestingControl = dynamic_cast(sender);
      Control ^ctrl = this->GetChildAtPoint(pt);
      Control ^ctrl2 = this->ActiveControl;  
      if( File::Exists(this->helpProvider->HelpNamespace ) == true)
      {
        Help::ShowHelp(this, this->helpProvider->HelpNamespace);
      }
    }
    

    ctrl is the form itself and crtl2 is the last active mdichild in my application. requestingControl returns the form and not the item the mouse is over. Hope someone can help :sigh:

    Programmer Glenn Earl Graham Austin, TX

    modified on Friday, January 04, 2008 1:56:26 PM

    L 1 Reply Last reply
    0
    • E earlgraham

      I want to have my compiled html help point to a topic specific to where the mouse is pointing but I can't seem to determine which control the mouse is hovering over.

      private: System::Void FrmMain_HelpRequested(System::Object^  sender, System::Windows::Forms::HelpEventArgs^  hlpevent) 
      {
        Point pt = this->PointToClient(hlpevent->MousePos);
        Control^ requestingControl = dynamic_cast(sender);
        Control ^ctrl = this->GetChildAtPoint(pt);
        Control ^ctrl2 = this->ActiveControl;  
        if( File::Exists(this->helpProvider->HelpNamespace ) == true)
        {
          Help::ShowHelp(this, this->helpProvider->HelpNamespace);
        }
      }
      

      ctrl is the form itself and crtl2 is the last active mdichild in my application. requestingControl returns the form and not the item the mouse is over. Hope someone can help :sigh:

      Programmer Glenn Earl Graham Austin, TX

      modified on Friday, January 04, 2008 1:56:26 PM

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, have a look at the sender parameter, I expect it to hold the current control; the only thing required typically is a cast. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Happy 2008!


      E 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, have a look at the sender parameter, I expect it to hold the current control; the only thing required typically is a cast. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        Happy 2008!


        E Offline
        E Offline
        earlgraham
        wrote on last edited by
        #3

        It does not. The control is the form not the menu item. I have updated my code. Thanks for the suggestion. :sigh: :((

        Programmer Glenn Earl Graham Austin, TX

        L 1 Reply Last reply
        0
        • E earlgraham

          It does not. The control is the form not the menu item. I have updated my code. Thanks for the suggestion. :sigh: :((

          Programmer Glenn Earl Graham Austin, TX

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi Glenn, that's too bad, I don't know then. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Happy 2008!


          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