473,414 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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.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
8 1331
Peter,

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

Cor
Nov 21 '05 #2
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
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
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
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
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
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
Peter,

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

Cor
Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: Andrew DeFaria | last post by:
I thought this would be fairly straight forward but apparently it's not. Given the following html file: <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head>...
3
by: Frank T. Clark | last post by:
How do I redirect or capture keydown events in a parent form from a child form? I have a main form which displays another informational form marked "SizableToolWindow". Form child = new...
3
by: Keith Smith | last post by:
Whenever a Keydown EventHandler is processed the computer never continues on to process the KeyPress EventHandler. Is there a way to stop this? My goal is to be able to detect these keys from...
3
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I...
4
by: Anne | last post by:
hie again, i have 3 textbox and i would like the user to go to the next textbox by pressing the 'ENTER' key. i have tried using this: Private Sub txtRequestor_KeyDown(ByVal sender As...
6
by: Pieter | last post by:
Hi, I developed an Outlook Add In (VB.NET 2005, for Outlook 2003) that sometimes suddenly stops loading. I've put everywhere in the code Exception Handlers, but no Exception is catched. it...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
1
by: dana1 | last post by:
I have a form with several combo boxes in the header used to determine the records that will be displayed on the form. When I tab or enter from the last combo box in the header, I want the focus to...
5
by: ApexData | last post by:
This follows a previous post, when I was trying to capture a key pressed during the immediate opening of a form (ie in the first 3-secs before processing any of the code that followed it. It was...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.