Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Associate contex menu with Appointment (Read 3266 times)
KatieP
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Oct 31st, 2006
Associate contex menu with Appointment
Nov 6th, 2006 at 2:29pm
Print Post  
I have a contex menu popping up when I right click on an existing appointment in TimeTable view but it does not appear very near to the cursor at all.

My code is:-

  Private Sub mfCalendar_ItemClick(ByVal sender As Object, ByVal e As MindFusion.Scheduling.WinForms.ItemMouseEventArgs) Handles mfCalendar.ItemClick
     
       ' Right click
       If e.Button = MouseButtons.Right And e.Clicks = 1 Then
           cmnuItem.Show(mfCalendar, Cursor.Position)

Is it possible to get the menu to pop up next to the cursor?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Associate contex menu with Appointment
Reply #1 - Nov 7th, 2006 at 7:18am
Print Post  
The Show method of the ContextMenu class accepts a point relative to the client coordinates of the control passed as a first argument. The Cursor.Position, however, returns a point in screen coordinates. In order to convert the screen point to a client point, use the following code:

Code
Select All
cmnuItem.Show(mfCalendar, mfCalendar.PointToClient(Cursor.Position)) 



Meppy
  
Back to top
 
IP Logged
 
KatieP
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Oct 31st, 2006
Re: Associate contex menu with Appointment
Reply #2 - Nov 7th, 2006 at 7:30am
Print Post  
Thanks very much, Meppy, that works fine.  Smiley

I am new to VB.NET so I apologise for not realising that.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Associate contex menu with Appointment
Reply #3 - Nov 7th, 2006 at 9:25am
Print Post  
Its ok, Katie Smiley

Have fun with Planner.NET.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint