very new to vb.net , how do you pass variables from form 1 to form 2
Hi
I am very new to vb.net , it def seems the wat to go though ! I will stick at it even though I am having problems with the most basic of things just now.
My first problem is passing a variable that has been declared on form1 to form 2 , even though I have decleared the variable as public on form1 form 2 will not let me use it.
How do I do this ?
Also my second problem is this
I wanted to loop through all the controls that are text boxes on a form and set them to enabled = false
I used to do this
dim mycontrol as control
for each mycontrol in me
If TypeOf mycontrol Is TextBox Then mycontrol.Locked = True
if TypeOf mycontrol Is ComboBox Then mycontrol.Locked = True
next
but .net objects to this and highlights the me word
how can I do this in vb.net without locking all controls one by one
many thx for your help
Re: thanks for replying guys
Quote:
Originally posted by locutus
public arrnew(3) as string
filled it up with strings
then on frmaccounts did this in the frmaccounts load section
dim frmdata as new frmmain()
messagebox.show(frmdata.arrnew(1))
it brings up
dim frmdata as new frmmain() << that creates a NEW instance, not the old one you filled with data.
You need to remember that EVERYTHING is a class, and to use it you create a new copy of it. I am guessing that you load frmMain as your first form, if so then .Net is creating your copy of it on your behalf.
There are a few ways of going from here, but tell me what you are trying to do, and Ill reformat it to work.