Friday, 15 April 2011

c# - Control Layout On Form -



c# - Control Layout On Form -

c# windows form here. , know database construction perchance bad kraken it's have work with. table in database houses question , field names associated question. example, if question list 5 reasons came in today. fieldnames along lines of reason1, reason2, reason3, reason4, reason5. farther example, may paint image improve of how setup

pollquestion ----------- fieldname 5 reasons cam in? reason1 reason2 reason3 reason4 reason5 fav video saw? favorvideo 3 improvements? improve1 improve2 improve3

aite, need fieldnames line on 1 line there corresponding poll questions should read this

pollqusetion1 --- reason1 reason2 reason3 reason4 reason5 pollquestion2 ---- favorvideo pollquestion3 ---- improve1 improve2 improve3

i polling database , storing poll questions & fieldnames in 2 separate list variables, outputting flowlayout panel. trying utilize logic of maintain fieldnames on same lines pollquestion isn't working needed.

if (pollquestion != "") { flowlayoutpanel1.setflowbreak(fieldname, true); }

however, isn't giving me desired output. can more experience on matter, please assist me? , if farther coding needed, can produce well. in advance view, , provide insight!

edit ---- 111 output if statement gives me -

pollqusetion1 --- reason1 reason2 reason3 reason4 reason5 pollquestion2 ---- favorvideo pollquestion3 ---- improve1 improve2 improve3

edit ------ 2222 image of referencing of how if() statement works. need textboxes on 1 line, starting 2nd label test text & texbox on it's own line.

i think should maybe seek utilize tablelayoutpanel combined panel.

so starting table layout create 2 columns , many rows questions there. in first column set label (multiline, dock = fill) come in question text. in sec column set panel (also fill docked) insert text boxes (or checkboxes, radio buttons, etc) like, dock = top.

the next hard part determine heigth of each row. can accomplished counting number of field names per question , multiply magic number each alternative occupies (e.g. 20px) plus little padding (maybe 5px).

c# winforms textbox labels flowlayoutpanel

No comments:

Post a Comment