Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

F5 is not firing an event  when the focus is in Datagrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Techstudent - 02 Oct 2004 00:35 GMT
I am trying to implement the keyboard functionality in windows forms.
I am overriding the "ProcessDialogKey" method to capture the key strokes.
I could able to capture all the key strokes when the focus is not in the
datagrid.
When the focus is in datagrid i am running into problem:
when i press F5 its not firing any event, all other function keys are firing
an event which i could able to capture using ProcessDialogKey.

If any one has any suggestions can you please let me know.
your help is greatly appreciated.

Thanks
ClayB [Syncfusion] - 02 Oct 2004 11:12 GMT
Is F5 a shortcut key for some menu item or something of that nature? If so,
it will be caught before ProcessDialogKey is hit. But you might try catching
it in ProcessCmdKey which is hit before ProcessDlgKey.

===================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools

>I am trying to implement the keyboard functionality in windows forms.
> I am overriding the "ProcessDialogKey" method to capture the key strokes.
[quoted text clipped - 9 lines]
>
> Thanks
Techstudent - 04 Oct 2004 16:45 GMT
Thanks for the reply.

F5 is not a shortcut key.I tried ProcessDialogKey it didn't work

I can capture F5 if the focus is not in the grid.

It seems the issue is specific to F5 , i can capture other function keys
when the focus is in the grid.

Thanks

> Is F5 a shortcut key for some menu item or something of that nature? If so,
> it will be caught before ProcessDialogKey is hit. But you might try catching
[quoted text clipped - 18 lines]
> >
> > Thanks
ClayB [Syncfusion] - 04 Oct 2004 19:20 GMT
If I use this code for a derived datagrid, both overrides are hit when I
press F5 whether there is an active cell or not. If I add a menu handler
that uses F5 to the form holding this control, only the ProcessCmdKey is
hit. I am using .NET 1.1 and WinXP. Do you have any utilities running on
your system that might make special use of F5?

public class MyDataGrid : DataGrid
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
 if(keyData == Keys.F5)
  Console.WriteLine("ProcessCmdKey");
 return base.ProcessCmdKey (ref msg, keyData);
}

protected override bool ProcessDialogKey(Keys keyData)
{
 if(keyData == Keys.F5)
  Console.WriteLine("ProcessDialogKey");
 return base.ProcessDialogKey (keyData);
}
}

===============================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools
> Thanks for the reply.
>
[quoted text clipped - 33 lines]
>> >
>> > Thanks
Techstudent - 04 Oct 2004 23:03 GMT
Hi Clay,

Thanks, ProcessCmdKey seems to be working. I tried this one before it didn't
work, may be i might have done some thing wrong.

Thanks for your help.

Thanks

> If I use this code for a derived datagrid, both overrides are hit when I
> press F5 whether there is an active cell or not. If I add a menu handler
[quoted text clipped - 60 lines]
> >> >
> >> > Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.