Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2004, 10:35 AM
Registered User
Join Date: Mar 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tray icon contextmenu function problem?


Problem: I want to set the contextmenu for a tray icon of a form so that when you click a menu selection, such as "Click to see form", the form appears, when the selection "Click to minimize form" the form disappears and "Exit", the program closes. I have loaded the form so that it does not appear but the tray icon in seen below. Also, I have the exit part working but again can not effect the appear part and the disappear part ( see below ).

I am trying to create a contextmenu for a tray icon using you example on pages 420, 421 & 422 of Beginning VB.Net 2nd Edition.

Public Class ExitMenuItem
    Inherits MenuItem

    ' Constructor...
    Public Sub New()
        Text = "Exit"
    End Sub

    ' OnClick...
    Protected Overrides Sub OnClick(ByVal e As System.EventArgs)

             ' Application.Exit()

     'I want to put some code here to make the form appear, such as
     ' me.visible = true

     ' but this code does not work
    End Sub

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)

        ' then, add an exit option...
        menu.MenuItems.Add(New ExitMenuItem())

        ' finally, tell the tray icon to use this menu...
        icnNotify.ContextMenu = menu

    End Sub

I would appreciate some help with this problem.


Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
system tray icon spoboyle Apache Tomcat 1 June 9th, 2004 10:29 AM
Who can help me set up a contextmenu for tray icon koolvbnet1 Pro VB.NET 2002/2003 1 May 26th, 2004 02:20 AM
Contextmenu for a tray icon problem? koolvbnet1 VB How-To 0 March 17th, 2004 12:27 PM
Contextmenu for a tray icon problem? koolvbnet1 VB.NET 0 March 8th, 2004 05:36 PM
Tray Icon Contextmenu Problem! koolvbnet1 VB.NET 2002/2003 Basics 0 March 8th, 2004 12:46 AM

All times are GMT -4. The time now is 10:57 AM.

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