how pass data between forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tcloud

    #1

    how pass data between forms

    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.
  • Herfried K. Wagner [MVP]

    #2
    Re: how pass data between forms

    "tcloud" <tcloud@discuss ions.microsoft. com> schrieb:[color=blue]
    > 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.[/color]

    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/>

    Comment

    • tcloud

      #3
      Re: how pass data between forms



      "Herfried K. Wagner [MVP]" wrote:
      [color=blue]
      > 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/>[/color]

      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.

      Comment

      • Wencheng Magiya

        #4
        Re: how pass data between forms

        How about set the RichTextBox's Modifiers to Public, and in main form use
        frmFind.RichTex tBox1.Text?


        "tcloud" <tcloud@discuss ions.microsoft. com> wrote in message
        news:2730BCC1-4BC1-4559-AB0F-D5104C60ECCD@mi crosoft.com...[color=blue]
        >
        >
        > "Herfried K. Wagner [MVP]" wrote:
        >[color=green]
        >> 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/>[/color]
        >
        > 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.[/color]


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: how pass data between forms

          "Wencheng Magiya" <goldlaser@hotm ail.com> schrieb:[color=blue]
          > How about set the RichTextBox's Modifiers to Public, and in main form use
          > frmFind.RichTex tBox1.Text?[/color]

          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/>

          Comment

          • Chad Z. Hower aka Kudzu

            #6
            Re: how pass data between forms

            =?Utf-8?B?dGNsb3Vk?= <tcloud@discuss ions.microsoft. com> wrote in
            news:FA3E3C87-4D32-4368-A00F-41E38EC12EBB@mi crosoft.com:[color=blue]
            > 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).[/color]

            Maybe this helps?


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


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

            Get your ASP.NET in gear with IntraWeb!

            Comment

            Working...