Gordon,
In VBNet is this one of the most difficult points. Even more because a lot
of people try to use the VB6 methods.
To do what you ask i reply what you told.
You have a main form that has the major textboxes
You have second form that you use to get the scores in a textbox and write
those to a file together with the two values from your mainform..
Although that I can tell you how to get the names from those textboxes on
form2, is that not a good method.
Better is to pass those values to your second form.
The best thing is to do that in the constructor, however that is as well a
little bit complicated when you are new.
Therefore I tell it you in the most easiest way.
You create on your second form two fields
Friend TheName as String ('str in advance is not done)
Friend TheValue as String (and not Name and Value because that are both
often used names in classes)
In your first form you set now where you open that second form
frm2 as new Form2
frm2.TheName = textbox1.text
frm2.TheValue = textbox2.text
frm2.showdialog 'now the process it stays at form2 because of that
showdialog and the process on form1 stops.
frm2.dispose 'this is one of the exceptions where dispose is adviced.
Now you can do what you want in Form2, except that you do not use that new
form Names however TheName and TheValue direct.
I hope this helps,
Cor
I assume that you did it on your mainform
"gordon" <go**********@o ptusnet.com.au> schreef in bericht
news:42******** *************** @news.optusnet. com.au...
I understand what you are saying in relation to transferrring code from one
version to another. My programming language is SAS and it is important to
code well. I am learning Vb.net and am trying to understand the language
by working through some small examples.
However, for my example, I am unable to get the code to work.
Let me put my need antother way.
I have two forms - i want to collect data from the first form and use it
in the second form.
My first form is called names and has textbox1 and textbox2 and a button
to take me to the second form called scores. The second form has more
information that is gathered and once a button is clicked it is appended
to the information from the textbox1 and textbox2 and then written out to
a text file.
If my first form is as I say - textbox1 and textbox2, how can i reference
these values elsewhere in my application?
Thanks
sorry If i have missed the point - but as I say i am new to vb.net.
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:OU******** ******@TK2MSFTN GP15.phx.gbl... Gordon,
As a side step
dim a as New A
is working in VBNet 2003
I don't think that anywhere is guaranteed that this will work in whatever
future version as well.
For VBNet it does at least in one thing not fulfil a programming rule.
It has to be understandable for somebody else who is well known with the
program language.
I hope this gives an idea.
Cor