Click here to Skip to main content
15,915,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threadin.Thread Problem Pin
Judah Gabriel Himango7-Jan-08 9:53
sponsorJudah Gabriel Himango7-Jan-08 9:53 
GeneralRe: Threadin.Thread Problem Pin
humayunlalzad8-Jan-08 20:56
humayunlalzad8-Jan-08 20:56 
GeneralWeb services in runtime Pin
Goncalo Oliveira7-Jan-08 5:31
Goncalo Oliveira7-Jan-08 5:31 
GeneralRe: Web services in runtime Pin
Pete O'Hanlon7-Jan-08 10:27
mvePete O'Hanlon7-Jan-08 10:27 
Generalreading bytes into directory Pin
gottimukkala7-Jan-08 5:24
gottimukkala7-Jan-08 5:24 
GeneralRe: reading bytes into directory Pin
Judah Gabriel Himango7-Jan-08 7:52
sponsorJudah Gabriel Himango7-Jan-08 7:52 
GeneralRe: reading bytes into directory Pin
Christian Graus7-Jan-08 9:34
protectorChristian Graus7-Jan-08 9:34 
QuestionCan you tell what menu item the mouse is pointing at? [modified] Pin
earlgraham7-Jan-08 5:15
earlgraham7-Jan-08 5:15 
In C# how would you do this? Can you?
I am working in C++/CLI with Windows Forms. No one in the C++/CLI forum was aware of a way to tell where the mouse is pointing when the helpprovider event is called.

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

My C++/CLI code is below.

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->pt;GetChildAtPoint(pt);
  Control ^ctrl2 = this->pt;ActiveControl;
  Point ptMI = this->menuMainForm->PointToClient(hlpevent->MousePos);  
  Control ^ctrlMI = this->menuMainForm->GetChildAtPoint(ptMI);
  Point ptMenuHelp = this->miHelp->DropDown->PointToClient(hlpevent->MousePos);
  Control ^ctrlMenuHelp = this->miHelp->DropDown->GetChildAtPoint(ptMenuHelp);
  if( File::Exists(this->pt;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 (same as ctrl)and not the item the mouse is over.
ctrlMI and ctrlMenuHelp are undefined.

Hope someone can help Sigh | :sigh:

Programmer
Glenn Earl Graham
Austin, TX

modified on Monday, January 07, 2008 4:03:51 PM

AnswerRe: Can you tell what menu item the mouse is pointing at? Pin
Judah Gabriel Himango7-Jan-08 6:24
sponsorJudah Gabriel Himango7-Jan-08 6:24 
GeneralRe: Can you tell what menu item the mouse is pointing at? Pin
earlgraham7-Jan-08 10:07
earlgraham7-Jan-08 10:07 
GeneralRe: Can you tell what menu item the mouse is pointing at? Pin
Judah Gabriel Himango7-Jan-08 10:22
sponsorJudah Gabriel Himango7-Jan-08 10:22 
AnswerRe: Can you tell what menu item the mouse is pointing at? Pin
PIEBALDconsult7-Jan-08 8:13
mvePIEBALDconsult7-Jan-08 8:13 
GeneralRe: Can you tell what menu item the mouse is pointing at? Pin
earlgraham7-Jan-08 10:10
earlgraham7-Jan-08 10:10 
AnswerRe: Can you tell what menu item the mouse is pointing at? Pin
Luc Pattyn7-Jan-08 9:04
sitebuilderLuc Pattyn7-Jan-08 9:04 
GeneralRe: Can you tell what menu item the mouse is pointing at? Pin
earlgraham7-Jan-08 10:13
earlgraham7-Jan-08 10:13 
GeneralRe: Can you tell what menu item the mouse is pointing at? Pin
Luc Pattyn7-Jan-08 11:27
sitebuilderLuc Pattyn7-Jan-08 11:27 
GeneralRe: Can you tell what menu item the mouse is pointing at? Pin
earlgraham8-Jan-08 8:52
earlgraham8-Jan-08 8:52 
Generalbrowse word document Pin
angels7777-Jan-08 4:51
angels7777-Jan-08 4:51 
GeneralRe: browse word document Pin
Judah Gabriel Himango7-Jan-08 5:03
sponsorJudah Gabriel Himango7-Jan-08 5:03 
GeneralRe: browse word document Pin
angels7777-Jan-08 14:37
angels7777-Jan-08 14:37 
GeneralRe: browse word document Pin
Judah Gabriel Himango8-Jan-08 4:08
sponsorJudah Gabriel Himango8-Jan-08 4:08 
GeneralCalender Control Pin
kibromg7-Jan-08 4:43
kibromg7-Jan-08 4:43 
GeneralRe: Calender Control Pin
Bekjong7-Jan-08 4:47
Bekjong7-Jan-08 4:47 
GeneralRe: Calender Control Pin
PIEBALDconsult7-Jan-08 4:47
mvePIEBALDconsult7-Jan-08 4:47 
GeneralRe: Calender Control Pin
kibromg7-Jan-08 5:13
kibromg7-Jan-08 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.