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

Deriving Form Events

I want to create a base form to derive all my forms from. In the base for I
want a KeyPress event to fire that when the enter key is pressed it acts
like the tab key and moves to the next control. How would I set this up in
my base form and how would I set it ip in forms that derive from it.
Samples would be great. Thanks

Ryan
Nov 15 '05 #1
2 1202
Ryan,

You would have to set the KeyPreview property to true. Then, you would
override the OnKeyDown and OnKeyUp methods to handle when the enter key was
pressed, and move the tab focus to the next control.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Ryan Wade" <te**@test.com> wrote in message
news:ec****************@TK2MSFTNGP11.phx.gbl...
I want to create a base form to derive all my forms from. In the base for I want a KeyPress event to fire that when the enter key is pressed it acts
like the tab key and moves to the next control. How would I set this up in my base form and how would I set it ip in forms that derive from it.
Samples would be great. Thanks

Ryan

Nov 15 '05 #2
So if I drive a form from another, the events don't automatically go the the
derived form? You have to overide them?

Thanks

Ryan

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:uT**************@TK2MSFTNGP12.phx.gbl...
Ryan,

You would have to set the KeyPreview property to true. Then, you would override the OnKeyDown and OnKeyUp methods to handle when the enter key was pressed, and move the tab focus to the next control.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Ryan Wade" <te**@test.com> wrote in message
news:ec****************@TK2MSFTNGP11.phx.gbl...
I want to create a base form to derive all my forms from. In the base
for I
want a KeyPress event to fire that when the enter key is pressed it acts
like the tab key and moves to the next control. How would I set this up

in
my base form and how would I set it ip in forms that derive from it.
Samples would be great. Thanks

Ryan


Nov 15 '05 #3

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

Similar topics

5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
28
by: Steven T. Hatton | last post by:
This may be another question having an obvious answer, but I'm not seeing it. I'm trying to create a class that derives from std::valarray<std::string>. I don't need a template, and I haven't come...
0
by: jphelan | last post by:
I have a subform that works fine until you import it into a new database when it crashes if you try to open it in either disign or form view. The form, "Attendees_Subform" in my application was...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
0
by: Marcin Grzêbski | last post by:
Hi Group, I know that if i want to run a windows form with ActiveX control and variables on it, i have to set attribute for Main() function. But if i want to deriving this form in other form...
8
by: Vincent Finn | last post by:
I know the answer to the question above is yes but my reason for asking is that it doesn't seem to work properly I have a manged C++ WinForms project In it I have a form A, I want to derive a...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
7
by: Miro | last post by:
I can use the property of the Form to remove the "x" from the top of the form. Is there a way in VB to leave the X there but program something so you cannot close the form? Or like an ONCLOSE...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.