Пример #1
0
        public void PrintAndReturn(Image imgImage)
        {
            if (_PrintImage.Width < _PrintImage.Height)
                PrintPotrait(_PrintImage);
            else
                Print(_PrintImage);
            

            Hide();
            var mainForm = new MainForm();
            mainForm.Show();
            return;
        }
Пример #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (comboBoxNumOfCopies.SelectedIndex == 0 || comboBoxNumOfCopies.SelectedIndex==-1)
            {
                XtraMessageBox.Show(this,
                    "Please select number of copies.", "Print Settings",
                   MessageBoxButtons.OK,
                   MessageBoxIcon.Asterisk);
                   //MessageBox.Show(this, "Please select number of copies.", "Print Settings", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            if (PrinterUtility.GetDefaultPrinters().Cast<ManagementBaseObject>().Any(printer => !printer.IsOnline()))
            {
                XtraMessageBox.Show(this,
                    "Printer is Offline or malfunctioned", "Printer status",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Asterisk);

                return;
            }

            var copies = Convert.ToInt32(comboBoxNumOfCopies.SelectedItem);
            for (var i = 0; i <= copies-1; i++)
            {
                if (_PrintImage.Width < _PrintImage.Height)
                    PrintPotrait(_PrintImage);
                else
                    Print(_PrintImage);
            }
            
            Hide();
            var mainForm=new MainForm();
            mainForm.UpdateLabel("Image " + _fileName + ".jpg sent to printer.");
            mainForm.Show();
        }
Пример #3
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     this.Hide();
     var mainForm =new MainForm();
     mainForm.Show();
 }
Пример #4
0
 private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     MainForm mainForm=new MainForm();
     mainForm.Update();
 }