S
Steve Howard
I guess I am still missing something in the Event Driven paradigm ...
I have a menu that gives the user access to sections in my code ... this is
a training application, so think of it as access to chapters.
When the user selects a button, I launch a 'splash' form that shows for a
couple of seconds, then I launch a second form that has course content. I
want some things to happen once the content form has opened, specifically
some audio needs to play.
When I close the Splash form and open the Content form, the audio plays
after about 2 seconds as expected, but the Splash form is still on screen.
Initially I used one container for the forms, like this
newForm= new SectSplash(ChoiceNum);
newForm.Show();
......
newForm = new Content(ChoiceNum);
//Show it
newForm.Show();
So I tried using two different containers:-
splash= new SectSplash(ChoiceNum);
splash.Show();
......
content= new Content(ChoiceNum);
//Show it
content.Show();
It made no difference.
I have tried a zillion combinations of Hide, Close, SentToBack and anything
else I could find.
I have tried all sorts in the opening form , running the code to play audio
on Load, on getFocus, on Activated etc, and even tried putting in a cludgy
delay in numerous different places to try to give the PDA time to kill the
form
for (int i = 1; i <= 100000; i++)
{
//nothing;
}
None of this seems to change the fact that the audio plays when the Splash
*should* be gone, but is somehow still visible.
Having said all that, here's the code.
private void LaunchSplash(int ChoiceNum)
{
splash = new SectSplash(ChoiceNum);
//Show it
splash.Show();
Clock = new Timer();
Clock.Interval = 2000;
Clock.Enabled = true;
this.Clock.Tick += new System.EventHandler(this.Clock_Tick);
}
void Clock_Tick(object Sender, EventArgs e)
{
//close slash
splash.SendToBack();
splash.Close();
//Stop timer
Clock.Enabled = false;
//Launch the lesson
launchLesson();
}
private void launchLesson()
{
switch (choiceNum)
{ // Set DECtalk voice
I have a menu that gives the user access to sections in my code ... this is
a training application, so think of it as access to chapters.
When the user selects a button, I launch a 'splash' form that shows for a
couple of seconds, then I launch a second form that has course content. I
want some things to happen once the content form has opened, specifically
some audio needs to play.
When I close the Splash form and open the Content form, the audio plays
after about 2 seconds as expected, but the Splash form is still on screen.
Initially I used one container for the forms, like this
newForm= new SectSplash(ChoiceNum);
newForm.Show();
......
newForm = new Content(ChoiceNum);
//Show it
newForm.Show();
So I tried using two different containers:-
splash= new SectSplash(ChoiceNum);
splash.Show();
......
content= new Content(ChoiceNum);
//Show it
content.Show();
It made no difference.
I have tried a zillion combinations of Hide, Close, SentToBack and anything
else I could find.
I have tried all sorts in the opening form , running the code to play audio
on Load, on getFocus, on Activated etc, and even tried putting in a cludgy
delay in numerous different places to try to give the PDA time to kill the
form
for (int i = 1; i <= 100000; i++)
{
//nothing;
}
None of this seems to change the fact that the audio plays when the Splash
*should* be gone, but is somehow still visible.
Having said all that, here's the code.
private void LaunchSplash(int ChoiceNum)
{
splash = new SectSplash(ChoiceNum);
//Show it
splash.Show();
Clock = new Timer();
Clock.Interval = 2000;
Clock.Enabled = true;
this.Clock.Tick += new System.EventHandler(this.Clock_Tick);
}
void Clock_Tick(object Sender, EventArgs e)
{
//close slash
splash.SendToBack();
splash.Close();
//Stop timer
Clock.Enabled = false;
//Launch the lesson
launchLesson();
}
private void launchLesson()
{
switch (choiceNum)
{ // Set DECtalk voice