private void backgroundPropertiesToolStripMenuItem_Click(object sender, EventArgs e) { ResizePreviewForm resizeForm = new ResizePreviewForm(previewForm.Preview.Background.Width, previewForm.Preview.Background.Height); if (resizeForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { previewForm.Preview.ResizeBackground(resizeForm.Width, resizeForm.Height); } }
private void backgroundPropertiesToolStripMenuItem_Click(object sender, EventArgs e) { ResizePreviewForm resizeForm = new ResizePreviewForm(previewForm.Preview.Background.Width, previewForm.Preview.Background.Height); if (resizeForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (resizeForm.Height > 10 && resizeForm.Width > 10) { previewForm.Preview.ResizeBackground(resizeForm.Width, resizeForm.Height); previewForm.Refresh(); } else { MessageBox.Show("An invalid image size was specified!", "Invalid Size", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } } }
private void backgroundPropertiesToolStripMenuItem_Click(object sender, EventArgs e) { ResizePreviewForm resizeForm = new ResizePreviewForm(previewForm.Preview.Background.Width, previewForm.Preview.Background.Height); if (resizeForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (resizeForm.Height > 10 && resizeForm.Width > 10) { previewForm.Preview.ResizeBackground(resizeForm.Width, resizeForm.Height); previewForm.Refresh(); } else { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("An invalid image size was specified!", "Invalid Size", false, true); messageBox.ShowDialog(); } } }