Hi,
I want some of the variables to use in different forms & not creating new & separate variables for each form of vb.net application!
Is this possible? How?
Hi,
I want some of the variables to use in different forms & not creating new & separate variables for each form of vb.net application!
Is this possible? How?
To declare a variable for all forms you have to declare it as Public.
Just write Public instead of Dim.
For Example:
Public txt$
Then you can access the txt variable form everywhere in the application.
To load a text from a textfile:
Open Textfilename for Input as #1
Text1.text = Input(Lof(1), 1)
Close #1
This is really fast and puts all the content of the file into a textbox
U declare the variable as a global variable.
Make it a Public or Friend property (or member variable...but usually Property is better).
Hi
Best way to access variables in outside form
you can declare variables in module.
by default module variables as public so you can access these variables entire project.
Bookmarks