How to minimize an application to system tray?
My application is developed in C#.Net. I have written code such that the Form minimizes to system tray if a button is clicked after selecting some settings from comboboxes. The button gets disabled after clicking once. So, I can't use that button to minimize the Form again. The Form pops up when a RichTextBox is populated with data received from COM port. Everything is working fine.
The problem is when the minimized Form pops up after it receives serial data I need an option to minimize it back to system tray again so that it can pop up again when new data is populated in the RichTextBox.
I don't want to add another button to do this whenever Form pops up. Is there any other way to do it?
It would be better if somebody provides code so that the app minimizes to system tray if minimize button in the title bar is clicked.
I just want to know the function name I have to use, something like private Form1_Resize(). Actually, Resize event can't be used because it triggers whenever form is minimized or maximized. I need it to trigger only when Form minimized.