|
-
November 10th, 2003, 12:39 PM
#1
Left click Context menu?
Hi all, how can I make a context menu appear on a left click? I must be doing it wrong because when I make it appear on a left click it is not lined up properly.
thanks!
Jim
I am scifi
-
November 10th, 2003, 04:35 PM
#2
handle mouse click
check button property
and if on Left click
show the context menu
- Software Architect
-
November 10th, 2003, 04:58 PM
#3
Yup, got that, but it's placement is not where it should be. Right click puts the context menu at the mouse cursor, but the left click calling the show() method of the context menu places the context menu about 50 pixels down and to the right.
here's my code to intercept the mouse click:
Code:
private void linkLabel_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Drawing.Point p = new Point(this.linkLabel.Size);
this.contextMenu1.Show(this.linkLabel, p);
}
I have also tried it this way with similar results:
Code:
private void linkLabel_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Drawing.Point p = new Point(this.Cursor.Size);
this.contextMenu1.Show(this.linkLabel, p);
}
My solution to this problem is to intercept both the left and right clicks so that the context menu placement is the same for both.
Thanks.
Jim
I am scifi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|