示例#1
0
        private void buttonAnzeigen_Click(object sender, EventArgs e)
        {
            //wenn ein Eintrag im Eingabefeld steht, laden wir das entsprechende Bild
            if (textBox1.Text != String.Empty)
            {
                //existiert die Datei überhaupt?
                if (System.IO.File.Exists(textBox1.Text))
                {
                    //wenn ja, dann laden und anzeigen
                    pictureBox1.Load(textBox1.Text);
                    if (checkBoxFenster.Checked == true)
                    {
                        //das neue Formular anzeigen
                        FormMax neuesFormular = new FormMax();
                        //das Formular modal anzeigen
                        neuesFormular.BildLaden(textBox1.Text);
                        neuesFormular.Text = "Große Darstellung - " + (openFileDialog1.FileName.ToString());
                        neuesFormular.ShowDialog();
                    }

                    else
                    {
                        //wenn ja, dann laden und anzeigen
                        pictureBox1.Load(textBox1.Text);
                    }
                }
                else
                {
                    MessageBox.Show("Die Datei existiert nicht!", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#2
0
 private void buttonAnzeigen_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != String.Empty)
     {
         if (System.IO.File.Exists(textBox1.Text))
         {
             if (checkBoxNeuesFenster.Checked == true)
             {
                 FormMax neuesFormular = new FormMax();
                 neuesFormular.BildLaden(textBox1.Text);
                 neuesFormular.Text = "Große Darstellung - " + textBox1.Text;
                 neuesFormular.ShowDialog();
             }
             pictureBox1.Load(textBox1.Text);
         }
     }
     else
     {
         MessageBox.Show("Die Datei existiert nicht!", "Fehler");
     }
 }