Wrox Programmer Forums
|
BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 by Thearon Willis, Bryan Newsome; ISBN: 9780764574016
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 23rd, 2007, 10:05 AM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Favorites Project - Right-Click Event

I have a mystery... Where does the right-click event on the system tray icon get handled? I can't find it. What if I want to detect a click event or mouse hover event on the icon in order to display the context menu? Is this possible?
Great Book. Thank You

 
Old October 23rd, 2007, 10:13 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

See steps 6 and 7 on page 369.

Thearon
 
Old October 23rd, 2007, 10:59 AM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I see how steps 6 and 7 on page 369 address the MenuItem_Click event, but what about how right-clicking the icon in the system tray gets handled? How does the menu get raised in the first place?
Thanks, Nat

 
Old October 23rd, 2007, 11:10 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Nat,

My mistake, I thought you did not understand where the steps were.

When you set the ContextMenu property for the NotifyIcon control, the control automatically setups the code internally to the control to respond to a right mouse click.

I hope this answers your question.

Thearon
 
Old October 24th, 2007, 08:14 AM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you. Wow. I did not expect to hear from the author. And so fast. It seems the handling of this event is not modifiable. I was just curious.
Nat

 
Old October 24th, 2007, 09:49 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Nat,

You can modify the handling of this event by overriding it in code. Add an event handler by selecting icnNotify in the Class Name combo box at the top left of the Code Editor and select the MouseClick event in the Method Name combo box. Then add your code in the event handler.

Thearon





Similar Threads
Thread Thread Starter Forum Replies Last Post
click event code mohiddin52 Access VBA 1 February 14th, 2006 01:52 PM
Click event on a subform cesather Access 3 December 14th, 2005 05:41 PM
Click Event dkr72 C# 3 December 8th, 2004 06:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.