keydown stops respondig (repost)

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

    keydown stops respondig (repost)

    Hi,

    this is my (simplified) situation:

    I have got 3 forms and one usercontrol:

    their names are:
    container (startup object),myform, another, mycontrol

    contair has got IsMdiContainer set to true, a mainmenu with a menuitem,
    which if you click it opens myform with the following piece of code:

    Dim objMy As New myform
    objMy.MdiParent = Me
    objMy.WindowSta te = FormWindowState .Maximized
    objMy.Show()



    on myform there's a tabcontrol with to tabpages, on the first tabpage
    there's a button and if you click it the form called "another" opens with
    this piece of code:

    Dim objAnother As New another
    objAnother.MdiP arent = MdiParent
    objAnother.Wind owState = FormWindowState .Maximized
    objAnother.Show ()

    on the second tabpage is myusercontrol which contains 2 textboxes if you
    press the enter key in the first textbox the focus is set to the second
    textbox and that's it.

    Now what's the problem I've got:
    If I run the project then click on the menuitem, and go to the second
    tabpage and press enter in the first textbox the keydown event fires ok.
    But if I first press on the button on the first tabpage which opens
    "another" form and close that form and then go to the second tabpage and
    press enter in the textbox the keydown doesn't fire.

    Attached is the testproject.

    Any help would be appreciated.

    Thanks in advance,

    Greetz Peter




  • Cor Ligthert [MVP]

    #2
    Re: keydown stops respondig (repost)

    Peter,

    In my newsreader your sample does not show up, did you zip it?

    Cor


    Comment

    • Peter Proost

      #3
      Re: keydown stops respondig (repost)

      Hi Cor I did zip it, but I forgot to remove the line which said the example
      was attached because it isn't attached with this post, this is because I
      also posted the question with the attachement 2days ago but I didn't get any
      reaction to that post. So that's why I reposted it without attachement
      because for example in google beta groups the post with the attachement
      didn't show up. But in my outlook express it shows, you can find the
      attachement in that post (dated 17/08/2005) with keydown stops responding as
      subject. If you can't find I'll repost the attachment this afternoon.

      Thanks in advance greetz Peter


      Comment

      • Cor Ligthert [MVP]

        #4
        Re: keydown stops respondig (repost)

        Peter,

        Can you describe this for me more step by step
        \\\
        Now what's the problem I've got:
        If I run the project then click on the menuitem, and go to the second
        tabpage and press enter in the first textbox the keydown event fires ok.
        But if I first press on the button on the first tabpage which opens
        "another" form and close that form and then go to the second tabpage and
        press enter in the textbox the keydown doesn't fire.
        ///
        Because when I click on the menuItem I dont see a second tabpage, for that I
        have to open first myform in your sample however am than not sure anymore if
        I do it correct.

        To test it, it is in my opinion really needed that you describe it step for
        step (for the wrong situation).

        .. Start program
        .. Click MyForm ? or something else

        For me (and I think as well for others who tried it) it is now a little bit
        a to difficult puzzle.

        Cor


        Comment

        • Peter Proost

          #5
          Re: keydown stops respondig (repost)

          Hi Cor,

          sorry I was a bit unclear but what I meant to say is,

          - Run the project then click on the open menuitem and then on the my form
          menuitem
          now the form with the 2 tabpages appears
          - Next go to the second tabpage and click in the textbox above the other
          textbox and press enter, the focus moves to the second textbox. This is what
          it should do.
          - Now close the form with the 2 tabpages and open it again, click on the
          button on the first tabpage, another form opens, just close this form and on
          the form with the 2 tabpages go to the second tabpage and click in the
          textbox above the other, press enter, now nothing happens.
          -Now if I put a break at the textbox_keydown event, it fires with every key
          I press except the return and enter key and that's my problem.

          I hope this is a bit more clear

          Greetz Peter and thanks in advance


          "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> schreef in bericht
          news:#$B8ZhKpFH A.1412@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Peter,
          >
          > Can you describe this for me more step by step
          > \\\
          > Now what's the problem I've got:
          > If I run the project then click on the menuitem, and go to the second
          > tabpage and press enter in the first textbox the keydown event fires ok.
          > But if I first press on the button on the first tabpage which opens
          > "another" form and close that form and then go to the second tabpage and
          > press enter in the textbox the keydown doesn't fire.
          > ///
          > Because when I click on the menuItem I dont see a second tabpage, for that[/color]
          I[color=blue]
          > have to open first myform in your sample however am than not sure anymore[/color]
          if[color=blue]
          > I do it correct.
          >
          > To test it, it is in my opinion really needed that you describe it step[/color]
          for[color=blue]
          > step (for the wrong situation).
          >
          > . Start program
          > . Click MyForm ? or something else
          >
          > For me (and I think as well for others who tried it) it is now a little[/color]
          bit[color=blue]
          > a to difficult puzzle.
          >
          > Cor
          >
          >[/color]


          Comment

          • Cor Ligthert [MVP]

            #6
            Re: keydown stops respondig (repost)

            Peter,

            I assume this is a know bug, I tried it in 2005 beta and there is is
            working.

            It does not help much, howewer ............... ........

            Cor


            Comment

            • Peter Proost

              #7
              Re: keydown stops respondig (repost)

              Cor,

              now I at least know that it isn't a mistake I've made,

              thanks for helping

              Greetz Peter

              --
              Programming today is a race between software engineers striving to build
              bigger and better idiot-proof programs, and the Universe trying to produce
              bigger and better idiots. So far, the Universe is winning.


              "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> schreef in bericht
              news:e0Y7p1LpFH A.1304@TK2MSFTN GP10.phx.gbl...[color=blue]
              > Peter,
              >
              > I assume this is a know bug, I tried it in 2005 beta and there is is
              > working.
              >
              > It does not help much, howewer ............... ........
              >
              > Cor
              >
              >[/color]


              Comment

              • Peter Proost

                #8
                Re: keydown stops respondig (repost)

                Cor what forgot to mention is that I think that it also has something to do
                with the focus, because if you in my example app drag the usercontrol from
                the second tabpage and put it on the form not on the tabcontroler and the
                run the app. You'll see that if you do the same thing: first push the button
                on the first tabpage, close the form that opens and click in the first
                textbox and if you then press enter you'll see that the form opens again
                because the button seams to handle the enter key being pressed and not the
                textbox as you would expect.
                When you then debug this by putting a break at the button click event you
                can see that in the command window - immediate 3 controls have got the
                focus:

                ?btnOther.Focus
                True
                ?MyControl1.Tex tBox1.Focus
                True
                ?MyControl1.Tex tBox2.Focus
                True

                Greetz Peter

                --
                Programming today is a race between software engineers striving to build
                bigger and better idiot-proof programs, and the Universe trying to produce
                bigger and better idiots. So far, the Universe is winning.

                "Peter Proost" <pproost@nospam .hotmail.com> schreef in bericht
                news:#K8lQ8LpFH A.3036@TK2MSFTN GP14.phx.gbl...[color=blue]
                > Cor,
                >
                > now I at least know that it isn't a mistake I've made,
                >
                > thanks for helping
                >
                > Greetz Peter
                >
                > --
                > Programming today is a race between software engineers striving to build
                > bigger and better idiot-proof programs, and the Universe trying to produce
                > bigger and better idiots. So far, the Universe is winning.
                >
                >
                > "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> schreef in bericht
                > news:e0Y7p1LpFH A.1304@TK2MSFTN GP10.phx.gbl...[color=green]
                > > Peter,
                > >
                > > I assume this is a know bug, I tried it in 2005 beta and there is is
                > > working.
                > >
                > > It does not help much, howewer ............... ........
                > >
                > > Cor
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Cor Ligthert [MVP]

                  #9
                  Re: keydown stops respondig (repost)

                  Peter,

                  There is a lot written in this newsgroup about focus problems with the
                  tabpage control.

                  Cor


                  Comment

                  Working...