private void newFileToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("是否保存当前文件?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { pbnF.saveTemp(); if (path == "") { SaveFileDialog sDlg = new SaveFileDialog(); sDlg.Filter = "牌例记录文件(*.pbn)|*.pbn"; if (sDlg.ShowDialog() == DialogResult.OK) { pbnF.Save(sDlg.FileName); } } else { pbnF.Save(path); } } pbnF = new PBNFile(); }
public Form1() { InitializeComponent(); TBArray[0, 0] = textBoxNS; TBArray[0, 1] = textBoxNH; TBArray[0, 2] = textBoxND; TBArray[0, 3] = textBoxNC; TBArray[1, 0] = textBoxES; TBArray[1, 1] = textBoxEH; TBArray[1, 2] = textBoxED; TBArray[1, 3] = textBoxEC; TBArray[2, 0] = textBoxSS; TBArray[2, 1] = textBoxSH; TBArray[2, 2] = textBoxSD; TBArray[2, 3] = textBoxSC; TBArray[3, 0] = textBoxWS; TBArray[3, 1] = textBoxWH; TBArray[3, 2] = textBoxWD; TBArray[3, 3] = textBoxWC; PBNFile.form1 = this; pbnF = new PBNFile(); Global_Random.init(); }