c# - Assign text to textbox when usercontrol is changed -
i building program generate mathematical questions , check , correct answer given user.
i have mainform panel add different usercontrols. in mainuc have button opens uc 3 buttons select of 3 difficulty levels. whenever click of these buttons open uc textbox in it. textbox going use method generate different questions. questions supposed differ in difficulty level, assigning value variable depending on difficulty user selects , in method checks difficulty chosen , generate code that. , have "next" button generates new question.
my problem is: textbox assigned question upon load. when of 3 difficulty buttons pressed, question generated textbox when uc freshly opened. doesn't. have press "next" button generate question. how can upon load of usercontrol?
it seems if usercontrol "static" cause loads whenever start program (tested running messagebox in initializecomponent), cause else could've done
this.textbox1.text = class1.generatequestion();
in initializecomponent in uc right? usercontrol loaded right away when start program can't that. how solve problem? been sitting days now.
here code (whole project): ufile.io/1d08w
Comments
Post a Comment