473,394 Members | 1,641 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,394 software developers and data experts.

IsInputKey

Thanks to vJ (Vijaye Raji) for pointing out IsInputKey to me. However i
admit i'm still confused about how to use it!! The scenario is i have a
form on which there is are some groupboxes with radiobuttons etc. In my
naivete thought "ok, set KeyPreview=true" and i can then handle all the keys
at the level of the form.

Not so fast, cowboy. Navigation keys like Keys.Right are swallowed whole--
my nice Form.KeyDown event handler waits patiently but never gets called.
Form.IsInputKey never gets called.

So following vJ's suggestion, i CAN override IsInputKey for each button on
each groupbox on the form, this works, but how to use this technique in
practice? Do i have to define ButtonEx and RadioButtonEx and subclass every
control that could be navigated to?

What's the right approach to this? Perhaps what i'm doing is simply wrong,
it breaks the standard ui using tabs and arrows to navigate between controls
and i should just rethink that, but is there any reasonable way to have
MainForm just handle them?

Thanks all in advance.
Nov 15 '05 #1
1 3468
You might be better off overriding ProcessCmdKey to trap arrows keys etc.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"woodBeeProgrammer" <wo***************@spamex.com> wrote in message
news:vt************@corp.supernews.com...
Thanks to vJ (Vijaye Raji) for pointing out IsInputKey to me. However i
admit i'm still confused about how to use it!! The scenario is i have a
form on which there is are some groupboxes with radiobuttons etc. In my
naivete thought "ok, set KeyPreview=true" and i can then handle all the keys at the level of the form.

Not so fast, cowboy. Navigation keys like Keys.Right are swallowed whole-- my nice Form.KeyDown event handler waits patiently but never gets called.
Form.IsInputKey never gets called.

So following vJ's suggestion, i CAN override IsInputKey for each button on
each groupbox on the form, this works, but how to use this technique in
practice? Do i have to define ButtonEx and RadioButtonEx and subclass every control that could be navigated to?

What's the right approach to this? Perhaps what i'm doing is simply wrong, it breaks the standard ui using tabs and arrows to navigate between controls and i should just rethink that, but is there any reasonable way to have
MainForm just handle them?

Thanks all in advance.

Nov 15 '05 #2

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

Similar topics

0
by: Bill1312 | last post by:
Hi I am trying to get an textbox control to work. All of the Key.values are working all except for the Backspace key I have the char value set to 8 Is there a different way of getting the...
8
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
2
by: melanieab | last post by:
Hi, Just checking to see if there's anything I can possibly do to allow for the recognition of the Tab key being pressed. On the KeyDown event I've tried: if (e.KeyCode == Keys.Tab), if...
1
by: Steve | last post by:
I would like to override the IsInputKey function in order to trap the arrow up/down keys in the Key Events. I understand that arrow keys don't have a char representation and thus, hard to trap. ...
6
by: Mike | last post by:
Hi, I have such problem: On my form I have TabControl. I want to move from one tab to another using "Next" and "Prev" button. This part works fine. But control also supports switching between...
11
by: Rlrcstr | last post by:
How can you detect when an arrow key gets pressed? Doesn't seem to trigger a KeyPress or KeyDown event. Thanks. Jerry
2
by: Helen Trim | last post by:
I am struggling to get the keydown event for checkboxes to work when pressing down arrow and enter. The so-called help talks about overriding the IsInputKey method for the controls, but doesn't...
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
0
by: Martijn Mulder | last post by:
/* I override IsInputKey() to direct the Arrow Keys (Cursor Keys) to my custom System.Windows.Forms.Control. But, holding down the Shift-Key prevents the Arrow Keys from coming through. How can...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.