Exchange data beetwen two forms...

  • Thread starter Thread starter Mrozu
  • Start date Start date
M

Mrozu

Hi

I have two forms. First frm1, second frm2. I want to click button on
frm1, and then textbox.text(txt) on frm2 = "hello". How?? What command
to button? I tried

Dim frm2 As New frm2
frm2.txt.Text = "hello"

but it isn't working. I have benn working with VB 6, and there it
wasn't any problem to do that...


Thx Mrozu
 
Yeah but look. I have showed frm2, and frm1:) And I click button on
frm1, and textbox on frm2 change. How??


Thx Mrozu
 
Mrozu,

In that case, you need to hang on to the reference to form2.

For example, in Form1's Declarations section:

Dim f As Form2

In Form1's Button1:

f = New Form2
f.Show()

Then in Form1's Button2, after Form2 has been shown:

f.TextBox1.Text = "Hello"

Kerry Moorman
 
Hey not this way:)

My project is:

On frm2 i click Button1 and then, frm1 show. Then, they are both shown.
And I click button on frm1, and then textbox on frm2 change. Is it
pellucidly writen:> Can you help me??:)

Your advice is, to show frm2 from frm1 , and then change textbox on
frm2. This way i was trying, but it can't be in my project.


Thx Mrozu
 
Mrozu,

You seem to add another piece of the problem with every post and I'm not
interested in playing that game.

My last remark on your problem: if you want to access data on one form from
another form, you must have a reference to the other form.

Kerry Moorman
 
Sorry

It wasn't wilful. I have frm2. On this form button.Click code for this
button is:

Dim frm1 as New frm1
frm1.show

So after click, frm1 form is shown.

And I want to click on this shown form button, and then textbox on frm2
(this main form ) immediately change. How?? That code, which you gave
me in last post, doesn't work.

Sorry, I know that I entangled, but I didn't know how discribe you my
problem

Please Kerry, I think that you can help me

Thx Mrozu
 

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

Back
Top