how pass data between forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

part of my application has a "Notepad" similar function with a separate
"Find" form.

-- how do I keep the Find form open yet have it pass data back to the Main
form to do repetitive searches -- llike Notepad ??

I've tried both "Show()" (which doesn't work) and "ShowDialog() (which works
fine but I don't know how to make it do repetitive "Next" searches).

It seems I need to do the searching from the Find form -- but I can't figure
out how to access the richtextbox form on the main form.
 
tcloud said:
part of my application has a "Notepad" similar function with a separate
"Find" form.

-- how do I keep the Find form open yet have it pass data back to the Main
form to do repetitive searches -- llike Notepad ??

I've tried both "Show()" (which doesn't work) and "ShowDialog() (which
works
fine but I don't know how to make it do repetitive "Next" searches).

It seems I need to do the searching from the Find form -- but I can't
figure
out how to access the richtextbox form on the main form.

Pass a reference that points to the richtextbox to the find form, in a
property, for example.
 
Herfried K. Wagner said:
Pass a reference that points to the richtextbox to the find form, in a
property, for example.

I'm sorry, but I don't understand that answer -- is there some place I can
see some sample code? I'm not an experienced programmer.
 
How about set the RichTextBox's Modifiers to Public, and in main form use
frmFind.RichTextBox1.Text?
 
Wencheng Magiya said:
How about set the RichTextBox's Modifiers to Public, and in main form use
frmFind.RichTextBox1.Text?

That would work too, but it's better to decouple the two form classes.
 
=?Utf-8?B?dGNsb3Vk?= said:
I've tried both "Show()" (which doesn't work) and "ShowDialog() (which
works fine but I don't know how to make it do repetitive "Next"
searches).

Maybe this helps?
http://www.codeproject.com/dotnet/WorkingWithWinForms.asp

Its similar - just call methods in addition to what it shows.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
 

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