private void loadImageToolStripMenuItem_Click(object sender, EventArgs e) { if (App.get_edited()) { dd = MessageBox.Show("Do you want to save changes ?", "My Application", MessageBoxButtons.YesNo); // Display a MsgBox asking the user to save changes or abort. if (dd == DialogResult.Yes) { // Cancel the Closing event from closing the form. //e.Cancel = true; App.set_action("save"); } } BGdialog.Multiselect = false; DialogResult d = BGdialog.ShowDialog(); if (d == DialogResult.OK) { bgURL = System.IO.Path.GetDirectoryName(BGdialog.FileName) + "/" + System.IO.Path.GetFileName(BGdialog.FileName); afterloading_activate(); App.set_action("load_image"); } }
private void duplicate_Click(object sender, EventArgs e) { App.logFile("duplicate started"); deactivatetext_options(); deactiveimage_options(); loadlogo.Enabled = false; saveAsToolStripMenuItem.Enabled = false; saveToolStripMenuItem.Enabled = false; addtext.Enabled = false; if (App.get_edited()) { dd = MessageBox.Show("Do you want to save changes ?", "My Application", MessageBoxButtons.YesNo); // Display a MsgBox asking the user to save changes or abort. if (dd == DialogResult.Yes) { // Cancel the Closing event from closing the form. //e.Cancel = true; App.set_action("save"); } } setpicturebox_image(null); App.delete_all(); App.set_edited(false); duplicate_check = true; MessageBox.Show("Select the list of images"); BGdialog.Multiselect = true; DialogResult d = BGdialog.ShowDialog(); if (d == DialogResult.OK) { string[] ss = new string[BGdialog.FileNames.Length]; this.Cursor = System.Windows.Forms.Cursors.WaitCursor; for (int i = 0; i < BGdialog.FileNames.Length; i++) { ss[i] = System.IO.Path.GetDirectoryName(BGdialog.FileNames[i]) + "/" + System.IO.Path.GetFileName(BGdialog.FileNames[i]); } App.setduplicate_list(ss); this.Cursor = System.Windows.Forms.Cursors.Default; MessageBox.Show("Select the logo"); BGdialog.Multiselect = false; d = BGdialog.ShowDialog(); if (d == DialogResult.OK) { string sss = System.IO.Path.GetDirectoryName(BGdialog.FileName) + "/" + System.IO.Path.GetFileName(BGdialog.FileName); App.setduplicate_logo(sss); MessageBox.Show("Edit the properties of the logo (position - size - opacity)"); setpicturebox_image(new Bitmap(10, 10)); set_size(App.getduplicate_logo().get_size()); set_position(App.getduplicate_logo().get_position()); set_opacity(App.getduplicate_logo().get_opacity()); xposition.Enabled = true; yposition.Enabled = true; widthsize.Enabled = true; heightsize.Enabled = true; opacitybar.Enabled = true; applybutton.Visible = true; cancelbutton.Visible = true; loadImageToolStripMenuItem.Enabled = false; } else { duplicate_check = false; App.logFile("duplicate aborted"); } } else { duplicate_check = false; App.logFile("duplicate aborted"); } }