I'm trying to create a form as an initial prototype for a much larger project.
I've built a dll with a form in Visual Studio targeted to Dot Net 4.5. I declare my using clause at the top:
using NinjatraderTest;
I then declare my form in my indicator class as follows:
NinjatraderForm frm;
I initially tried to instantiate the form in my State == State.SetDefaults:as follows
frm = new NinjatraderForm();
frm.Show();
and destroying it in the State.Terminated:
else if(State == State.Terminated)
{
frm.Close();
}
but I was getting multiple forms created whenever the Indicators form was was brought up. I realized my mistake and then moved the creation to State == State.Historical.
But this seems to work but the dialog seems hung. I then thought this may be due to the multithreading and tried to use the Dispatcher and moving the creation and termination to the functions called by the Dispatcher. However this does not seem to work as the form doesnt 'appear'.
Is there a concrete example on how to do this please?
Thank-you,
iq
Comment