system tray icon with popup menu

VB.NET

    Next

  • 1. list in memory
    For an asp.NET app. I have a list that I want to keep in memory. My choices are keeping the list in an asp.NET listbox control, session object, database, xml file. This list has values that need to be checked against the stack. If they're in the stack then they're in use, if not then I'm going to use or replace the values with new values I can use. What good consulting advice regarding this model and ways to keep a list in memory can anyone provide? Regards; Segue
  • 2. How to rewind a file
    Assume that the first line of a file is read with: InputLine = LineInput(FileNum) I believe a file can be rewound as follows: (So that the first line can be reread) FileClose(FileNum) 'Rewind FileOpen(FileNum, mDataInFullPath, OpenMode.Input) InputLine = LineInput(FileNum) Isn't there a better way? Thanks
  • 3. AllowNavigation in new DataGridView control for VS 2005
    Alright, I am having issues. I have a program that I want to display a grid of information and in this grid, each row will have children. It is telling me that there are children, but I have no idea how to display them. In the past, I used a dataGrid and set the allowNavigation property to true and it would put a plus next to each row. This is the same behavior that I would like with the DataGridView. Is this possible? Also, if it is possible, how would I display the information all at once. By this I mean that in the past with a dataGrid control, the user would have to click a child LINK. I don't want to have my users do this. I just want it all to show up. To do this, I had to go to a third party control, but I just got VS 2005 and figured that I would be able to do this. Please let me know if you need anything else from me, and any help on this would be great. Thanks, Darian
  • 4. Reading into a rectangular array
    Hi everyone, I have a "SqlDataReader" that I know has 2 columns in it with around 361 rows of data like: columnA columnB value1 value3 value1 value4 I am trying to read this into a rectangular string array called myArray()(). The problem is I don't know how!! Can anyone help me please? Any suggestions/comments/ideas/code-samples greatly welcomed. Thank you, Al.

system tray icon with popup menu

Postby Um9iZXJ0IFNtaXRo » Fri, 04 Mar 2005 06:24:14 GMT

Hello,
      I have often seen system tray icons that you click on and a popup menu 
appears. Is it possible to do this in Visual basic.net or are there any 
controls that allow this to be achieved.

Thanx in advance.

Robert

Re: system tray icon with popup menu

Postby Herfried K. Wagner [MVP] » Fri, 04 Mar 2005 06:28:43 GMT

"Robert Smith" < XXXX@XXXXX.COM > schrieb:

That's possible with the components which are contained in the .NET 
Framework class library:

<URL: http://www.**--****.com/ ;

-- 
 M S   Herfried K. Wagner
M V P  <URL: http://www.**--****.com/ ;
 V B   <URL: http://www.**--****.com/ ; 


Re: system tray icon with popup menu

Postby Jay B. Harlow [MVP - Outlook] » Fri, 04 Mar 2005 06:37:43 GMT

Robert,
Matthew MacDonald's book "Microsoft Visual Basic .NET Programmer's Cookbook"
has a topic on creating a system tray program.

Basically: Rather than using a Form as the startup object, use a Component
instead.

Create a new Component class (use Project - Add Component). Add a NotifyIcon
to the component designer.  Also add a ContextMenu object for the
NotifyIcon. When you click the menu, create and show the form. Remember to
put an Exit option on the menu.

Make the Component the startup object, adding a Shared Sub Main to the
component.

    Public Class Component1
        Inherits System.ComponentModel.Component

       ' Component designer generated code omitted.

        Public Shared Sub Main
            Dim app as New Component1
            Application.Run()
        End Sub

        Private Sub menuOptions_Click(...) Handles menuOptions.Click
            ' this would be your settings dialog.
            Dim dialog as New OptionsDialog
            dialog.ShowDialog()
            dialog.Dispose()
        End Sub

        Private Sub menuExit_Click(...) Handles menuExit.Click
            Me.Dispose()
            Application.Exit()
        End Sub

    End Sub

The problem is you cannot edit the menu from the Component  Designer. What I
do is use cut & paste from a Form Designer onto the Component Designer to
get the menu to the component...

The call to Me.Dispose enables the icon to be removed from the system tray
right away rather then waiting.

Hope this helps
Jay









Re: system tray icon with popup menu

Postby Q3JvdWNoaWUxOTk4 » Fri, 04 Mar 2005 14:41:02 GMT

There is a simple example in the VB.NET help. Just lookup NotifyIcon. There 
is an article called: 'Associating a Context Menu with a Windows Forms 
NotifyIcon Component', which is exactly what you want.

Re: system tray icon with popup menu

Postby Jay B. Harlow [MVP - Outlook] » Sat, 12 Mar 2005 02:04:04 GMT

Crochie,
Obviously if you like work & extra typing you can create a menu completely 
by scratch in code as that article suggests.

However! I prefer to use the designers to do the work for me. So my 
suggestion of using Cut & Paste seems to be exactly what *I* want :-)

Thanks for the link! I will try to remember to include it with my sample, so 
others will have both alternatives.

Hope this helps
Jay








Re: system tray icon with popup menu

Postby Q3JvdWNoaWUxOTk4 » Sat, 12 Mar 2005 03:05:03 GMT

I understand what you mean, jay. Sometimes I use the designer & others, I 
code it.

When it comes to either coding or using the properties window, I use code 
99% of the time. It's the way to do things in my eyes.

Similar Threads:

1.system tray icon ---> popup menu

I am trying to create a non-UI app that has an icon on the Pocket PC system 
tray. When the user clicks on the icon, I would like to show a pop-up menu.  
Can this be done in CF? Does anyone have a good example?  Thanks.

2.Popup Menu from System Tray doesn't disappear!

Hi,

Does anyone know why VB's PopupMenus called from within a SystemTray Icon
doesn't disappear when the user clicks elsewhere on the screen like any
other application does?

Just to be sure I'm making myself clear enough, here's what I'm doing :

- I have my application's icon sitting in the system tray when minimized
- When the user right-clicks on it, he/she gets a menu of options to choose
from
(I think this is pretty straightforward...)
- But whenever the user chooses to change his/her mind and clicks away from
the menu
to make it disappear it just won't work! User HAS to click on one of the
menu item to make it go away!

Any idea how to fix this?
Thanks in advace!


3.Remove Express Edition Tray icon from System Tray,...



Return to VB.NET

 

Who is online

Users browsing this forum: No registered users and 91 guest