Solved

Displaying vb.net form near the system tray

Posted on 2009-04-07
3
819 Views
Last Modified: 2012-05-06
Hello,

I am using the notify icon in my windows form. In the timer event, I display a small form. The form's startup position is set to Manual. But I want that this form to be displayed near the system tray just above my notify icon. This is just like what most anti-virus display a pop-up near the system tray. How do I accomplish this? Note I am using vb.net 3.5.

Regards,
MI
0
Comment
Question by:vj_mi
3 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24089279
Hi,
You can do something like this:

        Dim frm As New Form
        frm.StartPosition = FormStartPosition.Manual
        frm.Left = Screen.GetWorkingArea(Me).Width - frm.Width
        frm.Top = Screen.GetWorkingArea(Me).Height - frm.Height
        frm.Show()

Open in new window

0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 24089769
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 24090946
If the TaskBar has been docked to the Top or the Left side of the Screen, then the TrayIcons will be in a different location (not bottom right).

    Docked to Top --> Tray in Top Right
    Docked to Left --> Tray in Bottom Left

(plus I'm not sure what happens when you have a Right-to-Left language in use!)

If you want to detect which edge the TaskBar is docked to then you would use the SHAppBarMessage() API with the ABM_GETTASKBARPOS message.

I use it here: http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21722899.html

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question