vb.net - Carry objreader file being read over from form to form -
okay i'm making multiple-choice quiz game assignment , have form list of categories , actual questions. because i'm quite new @ coding , don't have whole lot of time totally restructure code in way wouldn't understand, instead of adding buttons 1 buttons "handles" made sub each click event. example of 1 of these subs:
public sub btnmusic_click(byval sender system.object, byval e system.eventargs) handles btnmusic.click questions.show() me.close() dim objreader new system.io.streamreader("music.txt") end sub
my text read following structure:
structure quizq dim q string dim string dim b string dim c string dim d string dim correct string end structure
i try read lines according structure with:
dim integer = 0 5 myq(i).q = objreader.readline myq(i).a = objreader.readline myq(i).b = objreader.readline myq(i).c = objreader.readline myq(i).d = objreader.readline myq(i).correct = objreader.readline next
and set text of buttons possible answers so:
lblquestion.text = myq(qnum).q btna.text = myq(qnum).a btnb.text = myq(qnum).b btnc.text = myq(qnum).c btnd.text = myq(qnum).d
but @ point text isn't displayed on buttons or question should be. have no idea point appreciated.
thank in advance!
Comments
Post a Comment