value in textbox cannot be refreshed by a global variable in vb.net -
value in textbox cannot be refreshed by a global variable in vb.net -
i have windows app. on 1 of forms(say form a), there button next textbox. when click button, there popup window textbox , buttons ok cancel on it, user can come in text on popup window txtbox, , click ok button close popup. used global variable hold user entered value , when popup closed value should displayed on textbox in form a. problem when run textbox doesn't display value. declared sub in form set textbox global variable, , in popup window btnok click event phone call sub before close, can see msgbox run , display right value, txtbox in form blank. don't know did wrong, please help, appreciate!!
here code: in popup window
private sub btnok_click(byval sender system.object, byval e system.eventargs) handles btnok.click ... gexptext = txtexp.text phone call frma.refreshtxt() ' not working 'frma.txtbx.text = cstr(gexptext) 'not working 'frma.txtbx.refresh() 'not working ' me.close() end sub
--------------- in form a------------
public sub refreshtxt() txtbx.text = cstr(gexptext) txtbx.refresh() 'txtbx.update() msgbox("hello") msgbox(gexptext) end sub
hi can declare property in pop window(say formb), on button click event, store value property. , access forma.
-in formb
private _gexptext string public property gexptext () string homecoming _gexptext end set(byval value string) _gexptext = value end set end property private sub btnok_click(sender object, e eventargs) handles btnok.click gexptext = txtexp.text me.close() end sub
-in forma
public sub refreshtxt() dim formb new formb formb.showdialog() txtbx.text = formb.gexptext end sub
vb.net
Comments
Post a Comment