My first class

G

Guest

I have form1 with textBox1 containing the string 'abc'. I hit an apply button
and want form2 with textBox2 containing the string 'def' to be updated to
'abc'. I do not want to see Form2 at this point. When I hit the Button1, Form
2 loads and I see 'abc' in textBox2.

How do I write a class/module/other program to share the object and update
textBox2 in the fashion above.

If noone can write a sample, can you direct me to a simplified guide on the
web which deals with this in a similar fashion.

I have tried every way of avoiding the class approach because I thought it
would be simpler to somehow share the objects but the behaviour will not
support the functionality I require behing the Apply and Button1 requirements.

Marc
 
C

Cor Ligthert [MVP]

Marcm

If you really want to share them, than this is enough.

Class MyShares
Public shared myvalue as string
End Class

You can use this everywhere as MyShares.Myvalue

However try to avoid this, passing values between classes helps to keep the
memory usage low, this value will be forever in memory.

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top