By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

keydown stops respondig (repost)

P: n/a
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.WindowState = 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.MdiParent = MdiParent
objAnother.WindowState = 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


Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Peter,

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

Cor
Nov 21 '05 #2

P: n/a
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
Nov 21 '05 #3

P: n/a
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
Nov 21 '05 #4

P: n/a
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]" <no************@planet.nl> schreef in bericht
news:#$**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #5

P: n/a
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
Nov 21 '05 #6

P: n/a
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]" <no************@planet.nl> schreef in bericht
news:e0**************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #7

P: n/a
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.TextBox1.Focus
True
?MyControl1.TextBox2.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" <pp*****@nospam.hotmail.com> schreef in bericht
news:#K**************@TK2MSFTNGP14.phx.gbl...
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]" <no************@planet.nl> schreef in bericht
news:e0**************@TK2MSFTNGP10.phx.gbl...
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


Nov 21 '05 #8

P: n/a
Peter,

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

Cor
Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.