• 0

[C#] Interrupting Execution


Question

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

  • 0
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

  • 0

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.