473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to minimize to system tray ? VS 2003

Hello guys,

I have done a small utility and would like that an image be displayed
on the the windows tray (on bottom-right of the screen).

Also I would like that when one clicks on X (close) the application be
minimized and only the tray icon be visible.
When one clicks on the tray icon the application shoud return to its
normal status (normal/maximized, depending how it was when was
minimized).

Any suggestion or help on how to do that?
Any sample would be much apprecciated!

Thank you very much in advance!

-Pam

Jan 17 '06 #1
5 2105
Add a notify Icon to your form and capture the Forms Minimize event.
When a user minimizes a form Hide it from the task bar.

I have some code in a minute for you.

Jan 17 '06 #2
Private Sub Main_SizeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.SizeChanged
If Me.WindowState = FormWindowState.Minimized Then
Me.ShowInTaskbar = False
End If
End Sub

Jan 17 '06 #3
You need to add a NotifyIcon Control to your VB Form

Then, use the followig code as example:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub RestoreWindow()
Me.Show()

Me.WindowState = FormWindowState.Normal

Me.Focus()

End Sub

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Private Sub f_<SomeFormName>_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Resize

If Me.WindowState = FormWindowState.Minimized Then

Me.Hide()

endif

End Sub

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Private Sub NotifyIconMain_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NotifyIconMain.DoubleClick

RestoreWindow()

End Sub

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<pa***********@libero.it> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hello guys,

I have done a small utility and would like that an image be displayed
on the the windows tray (on bottom-right of the screen).

Also I would like that when one clicks on X (close) the application be
minimized and only the tray icon be visible.
When one clicks on the tray icon the application shoud return to its
normal status (normal/maximized, depending how it was when was
minimized).

Any suggestion or help on how to do that?
Any sample would be much apprecciated!

Thank you very much in advance!

-Pam

Jan 17 '06 #4
THANKS!! very kind of you!

What do you mean by "Add a notify Icon to your form" (sorry for the
ignorance!) ?

-Pam

Jan 17 '06 #5
Ah OK. I found the Notify icon!

Thank you very VERY much: you both are angels !!

-Pam

Jan 17 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Austin | last post by:
I wrote a GUI program with wxPython. In the window, there are 3 attributes on left top. "_" could let the program to minimize to tool bar. I want to let the program minimized to the system tray....
2
by: varadha | last post by:
Hi, i want to create a VC++ application that minimizes to system tray when i minimize it. This application should be running in the background and doing it process(Just like Yahoo messanger...
1
by: Xarky | last post by:
Hi, I followed the follwoing post to minimize application to system tray....
3
by: Maka Sili | last post by:
Hi, My VC++ application does not have a titlebar (and therefore no System menu, no minimize, no maximize and no close button). We have a custom button for minimize and close. When the app...
4
by: steve | last post by:
hi all, i was wondering how is it possible to add an extra box ( i think they are called boxes: upper right corner ...) in a form that will minimize it in the system tray? You know some...
5
by: Yancey Jones | last post by:
I am looking for some example code for minimizing a 3rd part app to the system tray. I am working on writing a service to control VMWare and when a user logs in, I would like to minimize the VMWare...
8
by: Avi G | last post by:
Hi, i've created an application and i want it to be minimized to the sys tray, how i do it? if you can direct me step by step even with create a small application and put it in the sys tray ...
1
by: zakhirn | last post by:
Anyone have code that creates a button that will Minimize Excel to the system tray. I do not need anything complicated like changing the minimize button or the close button to a minimize to...
3
by: Jimmy | last post by:
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.