Guest Posted March 13, 2009 Share Posted March 13, 2009 Im trying to show a trophy screen in my C# application similar to the Achievement screen on the xbox 360. This is the code im using... But the three usercontrols pop up at the same time, overlapping each other. The trophy screens close after 5 seconds... How do i get the code to wait until the first screen closes before opening the next one? // check for gold trophy if (trophies_Earned[0] == true) { Trophy_Screen tScreen = new Trophy_Screen(plugin_Name, "Gold"); parentForm.push(tScreen, "Trophy Awarded"); } // check for silver trophy if (trophies_Earned[1] == true) { Trophy_Screen tScreen = new Trophy_Screen(plugin_Name, "Silver"); parentForm.push(tScreen, "Trophy Awarded"); } // check for bronze trophy if (trophies_Earned[2] == true) { Trophy_Screen tScreen = new Trophy_Screen(plugin_Name, "Bronze"); parentForm.push(tScreen, "Trophy Awarded"); } Ive tried to use a while loop and Thread.Sleep but it seems to just hang the application... Any idea what to do? Thanks Link to comment Share on other sites More sharing options...
0 Antaris Veteran Posted March 13, 2009 Veteran Share Posted March 13, 2009 How about you make it so when the previous form closes, it triggers the close event on the other one? Link to comment Share on other sites More sharing options...
0 username(); Posted March 13, 2009 Share Posted March 13, 2009 If you are opening a new window, just call ShowDialog instead of Show (I think...double check the method names). Link to comment Share on other sites More sharing options...
0 Guest Posted March 13, 2009 Share Posted March 13, 2009 How about you make it so when the previous form closes, it triggers the close event on the other one? Of course... Should of thought of that... Thanks for the help BTW username() - Its a usercontrol panel that i was opening so that method wont work :p Link to comment Share on other sites More sharing options...
0 Weddings Posted March 14, 2009 Share Posted March 14, 2009 What about your title of post " Interrupting Execution " ? Do you try()catch() it Link to comment Share on other sites More sharing options...
0 Ran Sagy Posted March 14, 2009 Share Posted March 14, 2009 That depends on what you're trying to achieve here. From the sample code posted above, It seems you WANT all three controls to show, As you want to inform the user of all three trophies. As such, you can use what Antaris suggested, If this is really what you intended. Link to comment Share on other sites More sharing options...
Question
Guest
Im trying to show a trophy screen in my C# application similar to the Achievement screen on the xbox 360.
This is the code im using... But the three usercontrols pop up at the same time, overlapping each other.
The trophy screens close after 5 seconds...
How do i get the code to wait until the first screen closes before opening the next one?
// check for gold trophy if (trophies_Earned[0] == true) { Trophy_Screen tScreen = new Trophy_Screen(plugin_Name, "Gold"); parentForm.push(tScreen, "Trophy Awarded"); } // check for silver trophy if (trophies_Earned[1] == true) { Trophy_Screen tScreen = new Trophy_Screen(plugin_Name, "Silver"); parentForm.push(tScreen, "Trophy Awarded"); } // check for bronze trophy if (trophies_Earned[2] == true) { Trophy_Screen tScreen = new Trophy_Screen(plugin_Name, "Bronze"); parentForm.push(tScreen, "Trophy Awarded"); }Ive tried to use a while loop and Thread.Sleep but it seems to just hang the application...
Any idea what to do?
Thanks
Link to comment
Share on other sites
5 answers to this question
Recommended Posts