PC Review


Reply
Thread Tools Rate Thread

Cascading Inherited Forms Keydown Event Handlers

 
 
Tappy Tibbons
Guest
Posts: n/a
 
      11th Aug 2003
In all of our programs we design, we would like to embed certain keystrokes
that work for every single screen. For instance, we might want to make Ctl-P
always do a printscreen, and Ctl-V to pop up a standard version/help screen.

For maybe 60% of the other forms in our apps, we want to have certain other
keystrokes always do specific things, such as Ctrl-F to do a Find, Ctrl-A to
do an add.

Additionally, for all forms, we always want the option to add in extra
keystrokes that are specific to that form and that form only, such as Ctl-N
to maybe tab through tabpages, or some other highly specific task, related
only to that form.

So, it seems like we should make inherited forms. We have some set up, but
cannot seem to get all the keystroke handlers in all the right places. There
are a few different events that would seem to work, but we are not sure if
we are using them properly, or if putting them in one handler is better than
the other.

We have our uppermost parent base form, called frmBase1. In it we define the
"GLOBAL" keyhandlers Ctl-P and Ctl-V

Then we have our second form, called frmBase2. It inherits frmBase1. In it
we want to keep our global "GLOBAL" keyhandlers, as well as add in our
secondary keystroke handlers for about 60% of our forms.

Finally, we have our actual data form, that Inherits from frmBase2. In it we
want to have all Global, all secondary, and any custom key strokes specific
to that form.

Has anyone done this before? Any advice on which events to use? We tried
Keydown, OnKeydown, various overrides, as well as various overrides and made
sure to call Mybase.Keydown to cascade it upwards, but we just can't seem to
get it all working right.

Thanks!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Event Handlers to Inherited Controls stuppi Microsoft Dot NET Framework Forms 1 21st Dec 2007 11:50 AM
Outlook 2003, Designed Forms and button event handlers =?Utf-8?B?QUlL?= Microsoft Outlook Form Programming 3 13th Nov 2006 01:25 PM
Can't see event handlers in descendant forms Michael Rodriguez Microsoft C# .NET 2 27th Jun 2005 04:07 PM
Keydown event and Form Focus in MDI Child forms =?Utf-8?B?U2lvYmhhbg==?= Microsoft Dot NET Framework Forms 0 11th Jun 2004 10:09 AM
Inherited event handlers joe Microsoft C# .NET 1 5th Jan 2004 10:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:26 AM.