take variable value from other form
-
hi, im using VS2008 and working on windows form application, i have a problem, is it can i take variable value from other form to another one form, or variable value from same form but different event. for example: pivate sub button1_click(byval........ dim one as string one = "Hello" end sub then, i want take the value from variable 'one' and use it on another button click event for example: private sub button2_click(byval.... 'here is the problem about how can i take 'the value in variable 'one' at button1_click event to be use in 'this event end sub
-
hi, im using VS2008 and working on windows form application, i have a problem, is it can i take variable value from other form to another one form, or variable value from same form but different event. for example: pivate sub button1_click(byval........ dim one as string one = "Hello" end sub then, i want take the value from variable 'one' and use it on another button click event for example: private sub button2_click(byval.... 'here is the problem about how can i take 'the value in variable 'one' at button1_click event to be use in 'this event end sub
-
hi, im using VS2008 and working on windows form application, i have a problem, is it can i take variable value from other form to another one form, or variable value from same form but different event. for example: pivate sub button1_click(byval........ dim one as string one = "Hello" end sub then, i want take the value from variable 'one' and use it on another button click event for example: private sub button2_click(byval.... 'here is the problem about how can i take 'the value in variable 'one' at button1_click event to be use in 'this event end sub
try this..................... dim one as string pivate sub button1_click(byval........ one = "Hello" end sub then, if i want take the value from variable 'one' and use it on another button click event for example: private sub button2_click(byval.... msgbox (one) end sub
-
hi, im using VS2008 and working on windows form application, i have a problem, is it can i take variable value from other form to another one form, or variable value from same form but different event. for example: pivate sub button1_click(byval........ dim one as string one = "Hello" end sub then, i want take the value from variable 'one' and use it on another button click event for example: private sub button2_click(byval.... 'here is the problem about how can i take 'the value in variable 'one' at button1_click event to be use in 'this event end sub
If i understood your post right then First declare the the variable globaly and public on form first not in any procedure Public one as string then on second form dim frm as form1 msgbox(frm.one.tostring) ' u can use it any event of form2 Hope it will help u
Unless u don't give ur hundred percent whatever u r doning till there is no result of ur work...
-
hi, im using VS2008 and working on windows form application, i have a problem, is it can i take variable value from other form to another one form, or variable value from same form but different event. for example: pivate sub button1_click(byval........ dim one as string one = "Hello" end sub then, i want take the value from variable 'one' and use it on another button click event for example: private sub button2_click(byval.... 'here is the problem about how can i take 'the value in variable 'one' at button1_click event to be use in 'this event end sub
The best way to do this is to create a delegate that passes the value between forms. Or use a property ( NOT just a variable ) that allows you to get ( but not set ) the value if the second form is a child of the first. As for within the one form, place the variable at application scope. And, if you don't know that, you really need to buy a beginner book instead of relying on online help only.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.