Example #1
0
        public SysTrayApp()
        {
            HotKeyManager.RegisterHotKey(Keys.Oemtilde, KeyModifiers.Alt);
            HotKeyManager.RegisterHotKey(Keys.D0, KeyModifiers.Alt);
            HotKeyManager.RegisterHotKey(Keys.D1, KeyModifiers.Alt);
            HotKeyManager.HotKeyPressed += new EventHandler <HotKeyEventArgs>(HotKeyManager_HotKeyPressed);

            this.KeyPreview = true;

            PrintingManager.ListingAfterBarcode = false;

            // Create a simple tray menu with only one item.
            trayMenu = new ContextMenu();

            PrinterConfig = new PrinterConfiguration();
            AboutWindow   = new About();

            trayMenu.MenuItems.Add("Multi-Queue");
            trayMenu.MenuItems.Add("Configure Printers...", OpenPrinterConfiguration);
            trayMenu.MenuItems.Add("About", OpenAbout);
            //trayMenu.MenuItems.Add("About", OpenAbout);
            //trayMenu.MenuItems.Add("Check For ZPL");
            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 = "AutoPrint";

            // Add menu to tray icon and show it.
            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible     = true;
        }
Example #2
0
 private static void OpenPrinterConfiguration(object sender, EventArgs e)
 {
     if (PrinterConfig.Visible == false)
     {
         PrinterConfig.Visible = true;
     }
     else
     {
         PrinterConfig = new PrinterConfiguration();
     }
 }