static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     // Create a simple tray menu with only one item.
     trayMenu = new ContextMenu();
     trayMenu.MenuItems.Add("API", OnAPI);
     trayMenu.MenuItems.Add("Heating", OnHeating);
     trayMenu.MenuItems.Add("Exit", OnExit);
     // Create a tray icon. In this example we use a
     // standard system icon for simplicity, but you
     // can of course use your own custom icon too.
     trayIcon      = new NotifyIcon();
     trayIcon.Text = "LightwaveRF API";
     trayIcon.Icon = new Icon(SystemIcons.WinLogo, 40, 40);
     // Add menu to tray icon and show it.
     trayIcon.ContextMenu = trayMenu;
     trayIcon.Visible     = true;
     APIForm = new Form1();
     APIForm.Show();
     APIForm.Hide();
     HeatingForm = new HeatControl();
     HeatingForm.Show();
     HeatingForm.Hide();
     Application.Run();
 }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     // Create a simple tray menu with only one item.
     trayMenu = new ContextMenu();
     trayMenu.MenuItems.Add("API", OnAPI);
     trayMenu.MenuItems.Add("Heating", OnHeating);
     trayMenu.MenuItems.Add("Exit", OnExit);
     // Create a tray icon. In this example we use a
     // standard system icon for simplicity, but you
     // can of course use your own custom icon too.
     trayIcon      = new NotifyIcon();
     trayIcon.Text = "LightwaveRF API";
     trayIcon.Icon = new Icon(SystemIcons.WinLogo, 40, 40);
     // Add menu to tray icon and show it.
     trayIcon.ContextMenu = trayMenu;
     trayIcon.Visible     = true;
     APIForm = new Form1();
     APIForm.Show();
     APIForm.Hide();
     HeatingForm = new HeatControl();
     HeatingForm.Show();
     HeatingForm.Hide();
     Application.Run();
 }