473,726 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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


Nov 21 '05 #1
8 1343
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:#$******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP10.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.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" <pp*****@nospam .hotmail.com> schreef in bericht
news:#K******** ******@TK2MSFTN GP14.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******** ******@TK2MSFTN GP10.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
4912
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> <title>Test</title> </head> <body> <form method="post" action="javascript:">
3
6952
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 ChildForm(); this.AddOwnedForm (child);
3
1752
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 the same control... Shift-A (can only be detected by KeyPress) DEL (can only be detected by KeyDown) INSERT (can only be detected by KeyDown)
3
9228
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 click on a row (withs will turn blue then) and then click on it again . Now if I press any key the event will fire (except for the arrow keys). I also tried to override the IsInputKey => no luck. I also tried to override the ProcessCmdKey => With...
4
8635
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 System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtRequestor.KeyDown If e.KeyCode = Keys.Enter Then SendKeys.Send("{TAB}")
6
1689
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 seems that other add ins aren't loaded afterwarths (nod32). Does anybody know a way to find out why an outlook add could do this? and find out after the problem what caused the problem?
3
5251
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 handler does not see the combination. Now this control is contained within another control which is contained within another. The top most control does see the CTRL+Z. I can easily pass down the key info, but why does the nested control see...
1
5869
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 move to the first control on the form. When I Shift+tab from the first control on the form, I want the focus to move to the last control in the header. The form is a continuous form. The first control on the form is either a text box or a combo...
5
3027
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 mentioned that the KeyDown event fires the instant a key is pressed down. So, if you place the following code in a form, you'll see my concern.
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9182
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8101
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.