c# - Loop through popup windows -


i'm trying make quiz program. i've got questions answers in lists , trying create popup box each question, let user make choice, , go onto next popup question.

here's c#:

public partial class test  {  popup p = new popup();    public test()    {      initializecomponent();     testvalues = getquestions();      int numberofquestions;     numberofquestions = testvalues.count / 6;      (int = 0; < numberofquestions; i++)     {     runtest(i, numberofquestions);     }   }    private void runtest(int questionnumber,int numberofquestions)   {      stackpanel testpanel = new stackpanel();     textblock textblockquestion = new textblock();     textblock textblockscore = new textblock();      radiobutton buttona = new radiobutton();     radiobutton buttonb = new radiobutton();     radiobutton buttonc = new radiobutton();     radiobutton buttond = new radiobutton(); 

....blah blah blah fill stuff buttons , boxes...

    testpanel.children.add(textblockscore);     testpanel.children.add(textblockquestion);     testpanel.children.add(buttona);     testpanel.children.add(buttonb);     testpanel.children.add(buttonc);     testpanel.children.add(buttond);     border.child = testpanel;      p.child = border;     p.isopen = true; 

....blah blah blah if tests see if button choose corresponds correct answer or not.... example have things each of 4 buttons depending on if statements

    (if right)      buttonb.click += new routedeventhandler(right_click);      else      buttonb.click += new routedeventhandler(wrong_click);    }    void wrong_click(object sender, routedeventargs e)   {     countwrong++;     p.isopen = false;   }    void right_click(object sender, routedeventargs e)   {     countright++;     p.isopen = false;   }  } 

so right program shows first popup box. click on answer choice, popup box closes, , nothing. don't understand why not advancing in loop @ beginning create next popup box. there wrong organization of code or syntax problem? need break down popup smaller steps?

the popup may not closing. have tried, instead of loop, opening next popup in closed event of current popup?

i've found can you, @ least, know it's not exact answer question, may help: how close popup in silverlight?


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -