Ejemplo n.º 1
0
 private void showButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (myFiles.Count > 0 && Int32.Parse(textBox1.Text.ToString()) > 0)
         {
             Slides slideShow = new Slides(myFiles, Int32.Parse((textBox1.Text.ToString())));
         }
         else if (myFiles.Count <= 0)
         {
             MessageBox.Show("No images to show", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else if (Int32.Parse(textBox1.Text.ToString()) <= 0)
         {
             MessageBox.Show("Please enter an integer time interval > 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Please enter an integer time interval > 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 2
0
        private void Show_button_Click(object sender, EventArgs e)
        {
            //No items in listbox
            if (listBox1.Items.Count == 0)
            {
                MessageBox.Show("No images to Show.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                //call the slide form
                Slides slide = new Slides(interval_textBox.Text, listBox1.Items);
                slide.ShowDialog();
            }

            //invalid time interval
            catch
            {
                MessageBox.Show("Please enter an integer time interval > 0.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
Ejemplo n.º 3
0
 private void showButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (myFiles.Count > 0 && Int32.Parse(textBox1.Text.ToString()) > 0)
         {
             Slides slideShow = new Slides(myFiles, Int32.Parse((textBox1.Text.ToString())));
         }
         else if (myFiles.Count <= 0)
         {
             MessageBox.Show("No images to show", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else if (Int32.Parse(textBox1.Text.ToString()) <= 0)
         {
             MessageBox.Show("Please enter an integer time interval > 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch(Exception ex)
     {
         MessageBox.Show("Please enter an integer time interval > 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }