I have two forms.
LoadWorkstationFile asks users for the identifier that they want to load.
DisplayDataForm displays the identifier data that they selected on the previous screen.
In DisplayDataForm, they can click on the option to load new data, which calls LoadDataForm as ShowDiaglog:
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
var answer = MessageBox.Show("Do you wish to save the current work file before continuing?", "Confirmation",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (answer == DialogResult.Cancel)
return;
if (answer == DialogResult.Yes)
SaveWorkFile();
var prevworkstationid = Configuration.WorkstationId;
var lw = new LoadWorkstationFile();
lw.ShowDialog(this);
if (Configuration.WorkstationId != prevworkstationid)
{
LoadData();
}
}
As you can see, I offer them again with the same screen as before.
In LoadWorkstationFile, it has the following code:
if (this.Parent == null)
{
var sc = new ScanCheck();
sc.Show();
this.Hide();
}
Bootstrap is all right. When I want to load the data again, it will load, in the end I have 2 LoadWorkstationFile screens , since the parent is always zero.
? DisplayDataForm, .ShowDialog?
, .