vb.net - how to keep the selected checkbox when the form is close? -
i got checkbox , want retain selected ones when reopen form. here's done returns first selected checkbox only..
for each stritm string in str each ctl control in me.controls if typeof ctl checkbox if ctl.text = stritm dim cb checkbox = directcast(ctl, checkbox) cb.checked = true end if end if next next
and me out. tnx in advance. more power.
an easy way create global bool variable each check box holds true when check box checked , false when it's not. when close form variables keep values. once re-open form can set checked property matching variables through form load event
private sub frmmain_load(sender object, e eventargs) handles mybase.load checkbo1.checked = globalvar1 checkbo2.checked = globalvar2 checkbo3.checked = globalvar3 end sub
Comments
Post a Comment