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

winforms, DataGrid, Key press events... KeyUp, KeyPress" are ignored

How to get "Key press" event when i'm working with DataGrid (winforms).

Seems to me that standard events "KeyUp, KeyPress" are ignored :-(

Thank you
Nov 17 '05 #1
4 8468
Serdge Kooleman wrote:
How to get "Key press" event when i'm working with DataGrid (winforms).

Seems to me that standard events "KeyUp, KeyPress" are ignored :-(

Thank you


they work fine for me.

i created a form with two textboxes, textBox1 and textBox2.

private void textBox1_KeyUp(object sender, KeyEventArgs e) {
textBox2.Text = "keyup";
}

private void textBox1_KeyDown(object sender, KeyEventArgs e) {
textBox2.Text = "keydown";
}

i attached those methods to the KeyUp and KeyDown events and it all
worked great.

--
jeremiah();
Nov 17 '05 #2
Użytkownik "Serdge Kooleman" <Su***@web.de> napisał w wiadomo¶ci
news:eO*************@tk2msftngp13.phx.gbl...
How to get "Key press" event when i'm working with DataGrid (winforms).

Seems to me that standard events "KeyUp, KeyPress" are ignored :-(

Thank you


Hi,

Set property on the form: KeyPreview = True

Roman Halas
Nov 17 '05 #3
Thank you for argumenting... but... i use DataGrid, not textBox. for texBox
all is fine, thats true.
So "DataGrid" for Windows.
source code of this small test application is here:

http://examples.20m.com/CustomDataGrid.zip

picture of this form is here:
http://examples.20m.com/CustomGridForm.GIF
Set property on the form: KeyPreview = True i do not see this property :-(

private void dataGrid1_KeyUp(object sender,
System.Windows.Forms.KeyEventArgs e)
{ //not working !!
textBox1.Text = "KeyCode="+ e.KeyCode.ToString() + " ; KeyValue=" +
e.KeyValue.ToString();
}

they work fine for me.

i created a form with two textboxes, textBox1 and textBox2.

private void textBox1_KeyUp(object sender, KeyEventArgs e) {
textBox2.Text = "keyup";
}

private void textBox1_KeyDown(object sender, KeyEventArgs e) {
textBox2.Text = "keydown";
}

i attached those methods to the KeyUp and KeyDown events and it all worked
great.

Nov 17 '05 #4
to download example please use this link:
http://examples.20m.com/download.htm

still not working... :-(
Thank you for argumenting... but... i use DataGrid, not textBox. for
texBox all is fine, thats true.
So "DataGrid" for Windows.
source code of this small test application is here:
http://examples.20m.com/download.htm
Set property on the form: KeyPreview = True

i do not see this property :-(

private void dataGrid1_KeyUp(object sender,
System.Windows.Forms.KeyEventArgs e)
{ //not working !!
textBox1.Text = "KeyCode="+ e.KeyCode.ToString() + " ; KeyValue=" +
e.KeyValue.ToString();
}



Nov 17 '05 #5

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

Similar topics

1
by: Darren Wooding | last post by:
Hello, can anyone offer any advice, this one is driving me up the wall! 1. I am using a webform datagrid. 2. The columns are all dynamic and defined using templates (see code below). 3. I have...
16
by: MLH | last post by:
In Access 97 and Access 2.0 applications, if a command button has the focus, the spacebar will 'PRESS" the key. How does one go about disabling this annoying BEATURE?
0
by: David Elliott | last post by:
I have a Collection that inherits from CollectionBase and Implements IBindingList which I have bound to a DataGrid. So far everything works fine. However, I am missing one piece to the...
0
by: Robin Tucker | last post by:
Hi people, Is it possible for me to handle events raised by an object which is embeded in a web browser control, from my VB.NET code? I am able to gain access to the object itself through the...
0
by: San Diego Guy | last post by:
Hi all! I have Datagrid. Within that datagrid I have a drop down list that I set up some values in (a "collection") I set up an edit command column on the datagrid and wrote simple code to get...
0
by: Trapulo | last post by:
I've a datagrid filled with a collection of objects that inherits from basecollection. When I remove an item from this collection and then click onto the datagrid, I've always this error: ...
2
by: Jonathan | last post by:
Hi I need implement loosely coupled events to raise events in a Classibrary project from one Windows Application project, and hanlde these from other Windows Application project. I found this...
3
by: Zvi | last post by:
Hi! I have a form in an application that's being used for some workers at a call center, that has a small UI. It's just a clock so users on calls can see how long they have been on a call. I...
6
by: Smithers | last post by:
Just looking to compile a list of "all the ways to implement events". I'm NOT looking to get into the merits or mechanics of each in this thread... just want to identify them all - good, bad, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
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,...

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.