Home All Groups Group Topic Archive Search About

how pass data between forms

Author
30 Jun 2005 10:05 PM
tcloud
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.

Author
30 Jun 2005 10:15 PM
Herfried K. Wagner [MVP]
Show quote Hide quote
"tcloud" <tcl***@discussions.microsoft.com> schrieb:
> 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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
30 Jun 2005 10:31 PM
tcloud
"Herfried K. Wagner [MVP]" wrote:

> Pass a reference that points to the richtextbox to the find form, in a
> property, for example.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>

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.
Author
1 Jul 2005 8:42 AM
Wencheng Magiya
How about set the RichTextBox's Modifiers to Public, and in main form use
frmFind.RichTextBox1.Text?


Show quoteHide quote
"tcloud" <tcl***@discussions.microsoft.com> wrote in message
news:2730BCC1-4BC1-4559-AB0F-D5104C60ECCD@microsoft.com...
>
>
> "Herfried K. Wagner [MVP]" wrote:
>
>> Pass a reference that points to the richtextbox to the find form, in a
>> property, for example.
>>
>> --
>>  M S   Herfried K. Wagner
>> M V P  <URL:http://dotnet.mvps.org/>
>>  V B   <URL:http://classicvb.org/petition/>
>
> 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.
Author
1 Jul 2005 8:50 AM
Herfried K. Wagner [MVP]
"Wencheng Magiya" <goldla***@hotmail.com> schrieb:
> 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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
1 Jul 2005 11:32 AM
Chad Z. Hower aka Kudzu
=?Utf-8?B?dGNsb3Vk?= <tcl***@discussions.microsoft.com> wrote in
news:FA3E3C87-4D32-4368-A00F-41E38EC12EBB@microsoft.com:
> 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/