private DialogResult OpenFile() { if (DLG_Open.ShowDialog() == DialogResult.OK) { bool Open; if (FileChanged) { DialogResult result = PromptSave(); if (result == DialogResult.Yes) { result = SaveFileAs(); Open = (result == DialogResult.OK); } else { Open = (result != DialogResult.Cancel); } } else { Open = true; } if (Open) { LoadImage(new Bitmap(DLG_Open.FileName)); } return(DialogResult.OK); } return(DialogResult.Cancel); }
private void BTN_Open_Click(object sender, EventArgs e) { if (DLG_Open.ShowDialog() == DialogResult.OK) { string Path = DLG_Open.FileName; Bitmap ImageOpened = new Bitmap(Path); this.Visible = false; FRM_Main main = new FRM_Main(ImageOpened); main.ShowDialog(); this.Close(); } }