Thread Part 3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles A. Lackman

    #1

    Thread Part 3

    Hello and Thanks again,

    Maybe I am not explaining what I am looking for good enough and maybe I
    should not be using muli-threads at all. What I am after is the following:

    Form1 instantiates Form2 using SHOW, which is always on top. Form2 is a
    clipboard, where the user can copy and paste information into it and into
    Form3 which will filled with Textboxes.

    In Form2 (The clipboard) there is a button that says "Send Data To Form3".

    Background Info:

    Form1 has a button that say's "Add New Data". When the "Add New Data"
    button is clicked, From3 is displayed using SHOWDIALOG. Here the user can
    add new data to a database.

    When Form2's button is clicked ("Send Data To Form3"), I need Form3 to be
    displayed using SHOWDIALOG so that only one instance of the form is being
    used at a time. I still need Form2 (The clipboard) to be on top and still
    usable (Able to be moved and accessed)

    Thanks,

    Chuck



  • Robby

    #2
    Re: Thread Part 3

    Instead of threading could you just show as a normal top most form? When
    the selection is made on frm1PollDatabas e raise an event on the main form.
    You could then create frm1Modify on the main form, fill it with the
    properties needed from frm1PollDatabas e, destroy or continue with
    frm1PollDatabas e and then show frm1Modify as a dialogue from the main form.
    This seems to do the trick without all the unecessary threading.

    Is there any reason why you have to thread?

    Robby

    "Charles A. Lackman" <Charles@Create ItSoftware.net> wrote in message
    news:%23h1dZMK2 EHA.1124@tk2msf tngp13.phx.gbl. ..[color=blue]
    > Hello and Thanks again,
    >
    > Maybe I am not explaining what I am looking for good enough and maybe I
    > should not be using muli-threads at all. What I am after is the
    > following:
    >
    > Form1 instantiates Form2 using SHOW, which is always on top. Form2 is a
    > clipboard, where the user can copy and paste information into it and into
    > Form3 which will filled with Textboxes.
    >
    > In Form2 (The clipboard) there is a button that says "Send Data To Form3".
    >
    > Background Info:
    >
    > Form1 has a button that say's "Add New Data". When the "Add New Data"
    > button is clicked, From3 is displayed using SHOWDIALOG. Here the user can
    > add new data to a database.
    >
    > When Form2's button is clicked ("Send Data To Form3"), I need Form3 to be
    > displayed using SHOWDIALOG so that only one instance of the form is being
    > used at a time. I still need Form2 (The clipboard) to be on top and still
    > usable (Able to be moved and accessed)
    >
    > Thanks,
    >
    > Chuck
    >
    >
    >[/color]


    Comment

    • Charles A. Lackman

      #3
      Re: Thread Part 3

      Hello,

      Yes, this is how I originally programed it and it does not work the way I
      need it two.
      I raise the event in the Main form, where at the AddressOf the
      frm1Modify.Show Dialog is shown. This causes frm1PollDatabas e to become
      unusable (because of the ShowDialog). The only way I have been able to get
      the right effect is to SHOW the form. But then I have to recreate it
      everytime I need to use it, because when it is closed it is destroyed. I
      could capture the Closing event can cause the form to hide instead, which
      might be what I have to do, if I can't find a work around.

      We are getting closer, I think.

      Thanks,

      Chuck


      "Robby" <edmund@not.my. email.com> wrote in message
      news:OM$LBPL2EH A.3376@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Instead of threading could you just show as a normal top most form? When
      > the selection is made on frm1PollDatabas e raise an event on the main form.
      > You could then create frm1Modify on the main form, fill it with the
      > properties needed from frm1PollDatabas e, destroy or continue with
      > frm1PollDatabas e and then show frm1Modify as a dialogue from the main
      > form. This seems to do the trick without all the unecessary threading.
      >
      > Is there any reason why you have to thread?
      >
      > Robby
      >
      > "Charles A. Lackman" <Charles@Create ItSoftware.net> wrote in message
      > news:%23h1dZMK2 EHA.1124@tk2msf tngp13.phx.gbl. ..[color=green]
      >> Hello and Thanks again,
      >>
      >> Maybe I am not explaining what I am looking for good enough and maybe I
      >> should not be using muli-threads at all. What I am after is the
      >> following:
      >>
      >> Form1 instantiates Form2 using SHOW, which is always on top. Form2 is a
      >> clipboard, where the user can copy and paste information into it and into
      >> Form3 which will filled with Textboxes.
      >>
      >> In Form2 (The clipboard) there is a button that says "Send Data To
      >> Form3".
      >>
      >> Background Info:
      >>
      >> Form1 has a button that say's "Add New Data". When the "Add New Data"
      >> button is clicked, From3 is displayed using SHOWDIALOG. Here the user
      >> can add new data to a database.
      >>
      >> When Form2's button is clicked ("Send Data To Form3"), I need Form3 to be
      >> displayed using SHOWDIALOG so that only one instance of the form is being
      >> used at a time. I still need Form2 (The clipboard) to be on top and
      >> still usable (Able to be moved and accessed)
      >>
      >> Thanks,
      >>
      >> Chuck
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Serg

        #4
        Re: Thread Part 3

        As a general rule it's rare that you would need to use more than one UI
        thread in your application. I only know of couple ones, for example Windows
        Explorer, or a game with multiple users. Also think somebody will have to
        maintain your code and will have difficulty understanding it and/or why you
        needed extra UI threads, if any at all. Also once you get into threading you
        need to deal with synchronization which can mean that unless you know exactly
        what you are doing you will end up chasing bugs for days to come. For desktop
        applications I often ask do I need to get fancy, and if threads can be
        avoided, and sometimes a call to DoEvents can often save the headache. My 2
        cents.


        "Charles A. Lackman" wrote:
        [color=blue]
        > Hello,
        >
        > Yes, this is how I originally programed it and it does not work the way I
        > need it two.
        > I raise the event in the Main form, where at the AddressOf the
        > frm1Modify.Show Dialog is shown. This causes frm1PollDatabas e to become
        > unusable (because of the ShowDialog). The only way I have been able to get
        > the right effect is to SHOW the form. But then I have to recreate it
        > everytime I need to use it, because when it is closed it is destroyed. I
        > could capture the Closing event can cause the form to hide instead, which
        > might be what I have to do, if I can't find a work around.
        >
        > We are getting closer, I think.
        >
        > Thanks,
        >
        > Chuck
        >
        >
        > "Robby" <edmund@not.my. email.com> wrote in message
        > news:OM$LBPL2EH A.3376@TK2MSFTN GP12.phx.gbl...[color=green]
        > > Instead of threading could you just show as a normal top most form? When
        > > the selection is made on frm1PollDatabas e raise an event on the main form.
        > > You could then create frm1Modify on the main form, fill it with the
        > > properties needed from frm1PollDatabas e, destroy or continue with
        > > frm1PollDatabas e and then show frm1Modify as a dialogue from the main
        > > form. This seems to do the trick without all the unecessary threading.
        > >
        > > Is there any reason why you have to thread?
        > >
        > > Robby
        > >
        > > "Charles A. Lackman" <Charles@Create ItSoftware.net> wrote in message
        > > news:%23h1dZMK2 EHA.1124@tk2msf tngp13.phx.gbl. ..[color=darkred]
        > >> Hello and Thanks again,
        > >>
        > >> Maybe I am not explaining what I am looking for good enough and maybe I
        > >> should not be using muli-threads at all. What I am after is the
        > >> following:
        > >>
        > >> Form1 instantiates Form2 using SHOW, which is always on top. Form2 is a
        > >> clipboard, where the user can copy and paste information into it and into
        > >> Form3 which will filled with Textboxes.
        > >>
        > >> In Form2 (The clipboard) there is a button that says "Send Data To
        > >> Form3".
        > >>
        > >> Background Info:
        > >>
        > >> Form1 has a button that say's "Add New Data". When the "Add New Data"
        > >> button is clicked, From3 is displayed using SHOWDIALOG. Here the user
        > >> can add new data to a database.
        > >>
        > >> When Form2's button is clicked ("Send Data To Form3"), I need Form3 to be
        > >> displayed using SHOWDIALOG so that only one instance of the form is being
        > >> used at a time. I still need Form2 (The clipboard) to be on top and
        > >> still usable (Able to be moved and accessed)
        > >>
        > >> Thanks,
        > >>
        > >> Chuck
        > >>
        > >>
        > >>[/color]
        > >
        > >[/color]
        >
        >
        >[/color]

        Comment

        • Cor Ligthert

          #5
          Re: Thread Part 3

          Charles,

          Will you be so kind to stay in the original threads, than questions can be
          followed up, now you make that almost impossible and have others every time
          to start new, what cost in my opinion too much time searching for your
          original questions and answers on that.

          Cor

          "Charles A. Lackman" <Charles@Create ItSoftware.net>

          ...[color=blue]
          > Hello,
          >
          > Yes, this is how I originally programed it and it does not work the way I
          > need it two.
          > I raise the event in the Main form, where at the AddressOf the
          > frm1Modify.Show Dialog is shown. This causes frm1PollDatabas e to become
          > unusable (because of the ShowDialog). The only way I have been able to
          > get the right effect is to SHOW the form. But then I have to recreate it
          > everytime I need to use it, because when it is closed it is destroyed. I
          > could capture the Closing event can cause the form to hide instead, which
          > might be what I have to do, if I can't find a work around.
          >
          > We are getting closer, I think.
          >
          > Thanks,
          >
          > Chuck
          >
          >
          > "Robby" <edmund@not.my. email.com> wrote in message
          > news:OM$LBPL2EH A.3376@TK2MSFTN GP12.phx.gbl...[color=green]
          >> Instead of threading could you just show as a normal top most form?
          >> When the selection is made on frm1PollDatabas e raise an event on the main
          >> form. You could then create frm1Modify on the main form, fill it with the
          >> properties needed from frm1PollDatabas e, destroy or continue with
          >> frm1PollDatabas e and then show frm1Modify as a dialogue from the main
          >> form. This seems to do the trick without all the unecessary threading.
          >>
          >> Is there any reason why you have to thread?
          >>
          >> Robby
          >>
          >> "Charles A. Lackman" <Charles@Create ItSoftware.net> wrote in message
          >> news:%23h1dZMK2 EHA.1124@tk2msf tngp13.phx.gbl. ..[color=darkred]
          >>> Hello and Thanks again,
          >>>
          >>> Maybe I am not explaining what I am looking for good enough and maybe I
          >>> should not be using muli-threads at all. What I am after is the
          >>> following:
          >>>
          >>> Form1 instantiates Form2 using SHOW, which is always on top. Form2 is a
          >>> clipboard, where the user can copy and paste information into it and
          >>> into Form3 which will filled with Textboxes.
          >>>
          >>> In Form2 (The clipboard) there is a button that says "Send Data To
          >>> Form3".
          >>>
          >>> Background Info:
          >>>
          >>> Form1 has a button that say's "Add New Data". When the "Add New Data"
          >>> button is clicked, From3 is displayed using SHOWDIALOG. Here the user
          >>> can add new data to a database.
          >>>
          >>> When Form2's button is clicked ("Send Data To Form3"), I need Form3 to
          >>> be displayed using SHOWDIALOG so that only one instance of the form is
          >>> being used at a time. I still need Form2 (The clipboard) to be on top
          >>> and still usable (Able to be moved and accessed)
          >>>
          >>> Thanks,
          >>>
          >>> Chuck
          >>>
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...