473,385 Members | 2,003 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,385 software developers and data experts.

Passing KeyEvents to other classes

I'm trying to get a KeyEvent in a DateTimePicker to trigger, the problem is
that it's within a different control and the parent control intercepts the
call.
I'm trying to work with a DateGridDateTimePickerColumnStyle that I picked
off off a post on a forum, the class wasn't complete as the picker in the
grid doesn't respond to keyboard input.

Therefore I wrote this to put in the ColumnStyle rather than a standard
DateTimePicker so I could pass the event from the ColumnStyle to the picker:

public class DataGridPicker:DateTimePicker
{
private KeyEventHandler keyEvent;
public DataGridPicker()
{
keyEvent = new KeyEventHandler(InternalCallKeyUp);
}

public void CallKeyUp(object sender,KeyEventArgs e)
{
this.Invoke(keyEvent, new object[]{this,e});
}
private void InternalCallKeyUp(object sender,KeyEventArgs e)
{
this.OnKeyUp(e);
}
}

I wrote it like this because my intial direct call (when the internal
version was public at first) locked up the program which I figured this was
the standard threading problem you can get when trying to call control
methods from a different thread.
However i'm still left with the same problem, the application hangs and I
get no feedback about the problem.

I guess i'm doing this the wrong way, could someone point me in the right
direction?

Kind Regs
Jax
Nov 17 '05 #1
0 1005

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

Similar topics

0
by: Ed Severn | last post by:
I have a problem. My JTable has some rows that are editable via DefaultCellEditor(new JTextField()). I have attached a KeyListener to that JTextField object. When I type into the field, no...
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
25
by: Victor Bazarov | last post by:
In the project I'm maintaining I've seen two distinct techniques used for returning an object from a function. One is AType function(AType const& arg) { AType retval(arg); // or default...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
11
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to...
4
by: Ron Rohrssen | last post by:
I want to show a dialog and when the form (dialog) is closed, return to the calling form. The calling form should then be able to pass the child form to another object with the form as a...
10
by: Stan | last post by:
There are two ways to pass structured data to a web service: xml === <Order OrderId="123" OrderAmount="234" /> or class =====
12
by: scottt | last post by:
hi, I am having a little problem passing in reference of my calling class (in my ..exe)into a DLL. Both programs are C# and what I am trying to do is pass a reference to my one class into a DLL...
0
by: Gidi | last post by:
Hi, i have a dataGrid, and i allocated a keyevents for one of the cells (i did some manipulation on this cell), and i have a strange problem: all the keyevents work except the one i really need...
11
by: Macca | last post by:
Hi, I'm writing an application that will pass a large amount of data between classes/functions. In C++ it was more efficient to send a pointer to the object, e.g structure rather than passing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.