I tried the logic in 2 places
protected override void OnTermination()
and the logic doesn't work
public override void Dispose()
it triggers twice but also if i change times or instruments it will always ask.
What I want is when the user closes the chart (x) button top right when the function will trigger. How can I do this?
if (bSaveData == true)
{
DialogResult result1= MessageBox.Show("Save your file?","my message box"
, MessageBoxButtons.YesNo
, MessageBoxIcon.Information
, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
if(result1 == DialogResult.Yes )
{
writeTradeFile();
}
}
Comment