Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Scheduler and ToolStripMenu (Read 3655 times)
fractal07
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Location: France
Joined: Mar 13th, 2017
Scheduler and ToolStripMenu
Jul 26th, 2017 at 10:43am
Print Post  
Hi Meppy,

I'm working on a C# WinForms Scheduler and I'm stuck when I try to get the date where the user clicked, using a ToolStripMenu.
As you can see in the picture, at first the customer right-click on the scheduler (these are the coordinates I'm trying to get) and the he select an ToolStripMenuItem.
My goal is to get the date and resource of the first click...
I tried to get the client or screen position but it doesn't work :
Code
Select All
private void _ctxMenu_OnClick(object sender, EventArgs e)
{
    ToolStripMenuItem item = sender as ToolStripMenuItem;
    Point client = calendar.PointToScreen(Cursor.Position);
    _pointedResource = calendar.GetResourceAt(client);
    _pointedDate = calendar.GetDateAt(client);
}
 


Please, could you give me a tip to go further?
  

ToolStripMenu.jpg ( 114 KB | 210 Downloads )
ToolStripMenu.jpg
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Scheduler and ToolStripMenu
Reply #1 - Jul 27th, 2017 at 7:37am
Print Post  
Hi,

Get the coordinates of the mouse when the context menu is displayed, not when the user clicks on a menu item. For example, use the context menu's Opening event.

Regards,
Meppy
  
Back to top
 
IP Logged
 
fractal07
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Location: France
Joined: Mar 13th, 2017
Re: Scheduler and ToolStripMenu
Reply #2 - Jul 27th, 2017 at 9:59am
Print Post  
Thank you so much, it was the event I was looking for !
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint