|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to minimize to system tray ? VS 2003Hello 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 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. 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 THANKS!! very kind of you!
What do you mean by "Add a notify Icon to your form" (sorry for the ignorance!) ? -Pam 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 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ <pamelaflue***@libero.it> wrote in message Show quoteHide quote news:1137524398.196231.50120@g14g2000cwa.googlegroups.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 > Ah OK. I found the Notify icon!
Thank you very VERY much: you both are angels !! -Pam
Keep software running
The Irish fada (áéíóú/ÁÉÍÓÚ) and encryption/decryption problem! How to create a "DataSource" & "Items" properties on Custom Combob Binding sources question in Vs2005 Working with structures and the New keyword Detect Remote Shutdown Alignment problem displaying .txt file in window's textbox? Encyrption in VB and Decryption in VB.NET DataTable.Expression Microsoft.VisualBasic.Compatibility |
|||||||||||||||||||||||