How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object?
How do I handle a right click on an object? How do I handle a right click on an object?
How do I handle a right click on an object?
Go Back  Xtreme Visual Basic Talk > > > How do I handle a right click on an object?


Reply
 
Thread Tools Display Modes
  #1  
Old 07-12-2006, 08:35 AM
TexasAggie TexasAggie is offline
Junior Contributor
 
Join Date: Feb 2004
Location: San Antonio, TX
Posts: 286
Default How do I handle a right click on an object?


I have a waveform graph and I'd like to give the user the option to clear the graph after right clicking it. I'd like for the message box to show up starting at the cursor. This would be useful for several other programming needs as well. If you have code for handling the check for the msgbox being off the screen that would be great, but not necessary.

Thanks!
Reply With Quote
  #2  
Old 07-12-2006, 11:17 AM
JNewt's Avatar
JNewt JNewt is offline
Centurion
 
Join Date: Apr 2003
Location: KY (Home), ID (College)
Posts: 138
Default

The graph control should have a MouseDown (and MouseUp) event. One of the properties of the "e" MouseEventsArgs object is Button. Just check to see if the Button equals the right mouse button (there's an enumeration). MsgBox may take x and y values, not sure.
__________________
Erat autem fuenum multum in loco. -John 6:10
Please forgive my English -I'm a modern American.
Reply With Quote
  #3  
Old 07-13-2006, 01:55 PM
TexasAggie TexasAggie is offline
Junior Contributor
 
Join Date: Feb 2004
Location: San Antonio, TX
Posts: 286
Default

While one can specify a location using an input box, it does not appear to be possible with a msg box. How can one make a menu like you can generally see when you right click on say a Windows icon?
Reply With Quote
  #4  
Old 07-13-2006, 02:21 PM
JNewt's Avatar
JNewt JNewt is offline
Centurion
 
Join Date: Apr 2003
Location: KY (Home), ID (College)
Posts: 138
Default

You want the ContextMenu (or ContextMenuStrip in VB2005) control. Simply drop one onto your form, add the menu items just like you would for a main menu. There are two ways of displaying it: 1) if the graph control has a ContextMenu property, simply set this to the context menu you've created. 2) Using the graph's MouseUp event, call the Show method of context menu (you can pass the position where you'd like it to appear).
__________________
Erat autem fuenum multum in loco. -John 6:10
Please forgive my English -I'm a modern American.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object? How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object? How do I handle a right click on an object?
How do I handle a right click on an object?
How do I handle a right click on an object?
 
How do I handle a right click on an object?
How do I handle a right click on an object?
 
-->