vb.net - Take array from one form and display contents in labels on another form -


i working on code stores user's answers array , compares them array correct answers in it. have got part working. part stuck on having user's answers appear in labels on form( exam results form ) create array labels in other form, make equal array of user answers, reason not displaying on next form when click submit.

code:

'display user answers on exam result form     dim auseranswersdisplayed() string = {frmexamresults.lbluseranswer1.text, frmexamresults.lbluseranswer2.text,                                              frmexamresults.lbluseranswer3.text, frmexamresults.lbluseranswer4.text,                                              frmexamresults.lbluseranswer5.text, frmexamresults.lbluseranswer6.text,                                              frmexamresults.lbluseranswer7.text, frmexamresults.lbluseranswer8.text,                                              frmexamresults.lbluseranswer9.text, frmexamresults.lbluseranswer10.text,                                              frmexamresults.lbluseranswer11.text, frmexamresults.lbluseranswer12.text,                                              frmexamresults.lbluseranswer13.text, frmexamresults.lbluseranswer14.text,                                              frmexamresults.lbluseranswer15.text, frmexamresults.lbluseranswer16.text,                                              frmexamresults.lbluseranswer17.text, frmexamresults.lbluseranswer18.text,                                              frmexamresults.lbluseranswer19.text, frmexamresults.lbluseranswer20.text}      intdisplayanswers = 0 19         auseranswersdisplayed(intdisplayanswers) = auseranswers(intdisplayanswers)     next      frmexamresults.show() 

suppose have 2 form named form1 , form2 , want content form1 displayed on form2. here method can use

create new() method on form2

dim _value1 <datatype>,....... public sub new(byval value1 <datatype>,...........)     `initialization function create automatically`     _value1 = value1 end sub 

now on form1, call show() or showdialog() method after creating , using form2 object. methods show constructor defined in form1 created using new() method. pass desired values , have values on form2.

dim form1 a.showdialog(<parameters here>) 

hope helps..


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -