は、これはちょっと奇妙で、私はできる限りそれを説明してみましょう:C#Windowsフォーム:OpenFileDialog奇妙な問題
私は新しいファイルを作成し、それを保存し、それは(のtest.xml)が正しく保存されます。 このファイルに変更を加えて保存すると、正しく保存されます(test.xmlに) このファイルを再度変更するか、[名前を付けて保存]を選択すると正しく動作します(newtest.xml)
ただし、ファイルを開いたら、ファイル(test.xml)に変更を加え、Save it is saveing(newtest.xml)をクリックします。
これは、私はそれが私がEditoFormでやっているとしなければならないと確信している。これは私のEditorForm.csに
public void OpenFile(string strFileName)
{
diagramComponent.LoadSoap(mainForm.openEditorDialog1.FileName);
this.FileName = mainForm.openEditorDialog1.FileName;
this.tabControl1.SelectedTab = DiagramTab;
}
である私のMainForm.csに
if (this.openEditorDialog1.ShowDialog(this) == DialogResult.OK && editForm != null)
{
editForm.Close();
editForm = new EditorForm(this);
editForm.OpenFile(this.openEditorDialog1.FileName);
editForm.Closing += new CancelEventHandler(EditorForm_Closing);
editForm.MdiParent = this;
editForm.Show();
}
private void biFileSave_Click(object sender, EventArgs e)
{
if (!editForm.HasFileName)
{
if (this.saveEditorDialog1.ShowDialog(this) == DialogResult.OK)
{
this.ActiveDiagram.SaveSoap(this.saveEditorDialog1.FileName);
editForm.FileName = this.saveEditorDialog1.FileName;
}
}
else
{
this.ActiveDiagram.SaveSoap(this.saveEditorDialog1.FileName);
}
ですしかし、私はそれを把握していないようです。
私はそれを試してみるとNullReferenceException ... – jonalodev
うわー、私はそれが働いていることを忘れないでください。どうもありがとうございます :) – jonalodev