button - Declare Global Variable inside a Button1_Click -
i tried google abit could'nt find useful. in form1_load have variable
dim myvariable string
then in button click want
myvariable = "hello"
problem code tells me myvariable in button_click not declared is.
thanks help.
move variable field or property in form class. here example code:
public class form1 private myvariable private sub form1_load(sender system.object, e system.eventargs) handles mybase.load myvariable = "hello" end sub private sub button1_click(sender system.object, e system.eventargs) handles button1.click messagebox.show(myvariable) end sub end class
Comments
Post a Comment