jhopper28 Posted March 23, 2010 Report Share Posted March 23, 2010 I'm creating an AxisSection and highlighting it in the MouseDown, MouseMove and MouseUp events, and now I need to add some context menu items that appear only when the user right-clicks that section of the grid. I was guessing that I should use CommandId.ContextMenuAxisSection, but I can't find any explanation of it in the documentation or online, and I can't seem to get such a context menu to appear. When that section is right-clicked, the ContextMenuAxis appears, so I'm adding my menu items to that for now, but I really don't want those menu items to be available when the user actually clicks the axis. Is there a way to do what I want to do? What is the ContextMenuAxisSection used for? Quote Link to comment Share on other sites More sharing options...
jhopper28 Posted March 31, 2010 Author Report Share Posted March 31, 2010 Unfortunately, according to SoftwareFX support, you can't create your own Context Menu to be used only when you right click on the Axis Section. As a workaround, I'm adding the Context Menu Items to the Axis Context Menu and disabling the Context Menu Items depending where you the user is clicking, which is revealed in the MouseClick event's e (HitTestEventArgs) parameter. Something like this: Private Const MyCommandID As Integer = 1 Private Sub Chart_MouseClick(ByVal sender As System.Object, ByVal e As ChartFX.WinForms.HitTestEventArgs) _ Handles Chart.MouseClick If e.Button = MouseButtons.Right Then Chart.Commands(MyCommandID).Enabled = (e.HitType = HitType.AxisSection) End If End Sub Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.