473,657 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1216
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************* *@exisconsultin g.com

"Ryan Wade" <te**@test.co m> wrote in message
news:ec******** ********@TK2MSF TNGP11.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************ **@exisconsulti ng.com> wrote
in message news:uT******** ******@TK2MSFTN GP12.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************* *@exisconsultin g.com

"Ryan Wade" <te**@test.co m> wrote in message
news:ec******** ********@TK2MSF TNGP11.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
6084
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 Internet. Specifically, marking up a document that will contain multiple related form controls (intended exclusively for client-side scripting) that would never be intended to be submitted. I realise that that concept is a non-starter in an Internet...
28
4081
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 across any examples of a construct like what I show below. Perhapes it's simply a bad idea. If there is something fundamentally wrong with this approach please let me know. Can anybody tell me if there is a way to get the following to work? I...
0
1864
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 pattern after the same form used in the MS template, "Event Management.mdb" application that is downloaded from the MS Template Gallery on their website. I narrowed down the problem to the Control Source in the, "Attendees_Subform using the...
5
73205
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
973
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 then i've got exception when i run it's designer: "Unspecified error". I look on this exception's stack trace and i fing
8
1328
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 form B from it Firstly the menu that the MSDN says should be available from the 'Add' menu to 'Add an Inherited Form' isn't there This seems to only be available for C# and VB.Net
18
2956
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. If you do have any ideas I would really like to hear them. Thanks Colin - 0 - 0 - 0 - I want a glorified popup/context menu on a button that shows only when
7
6783
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 event that you can just put "cancel" ? If i remember correctly...back in vb 1.0 days or so there was a canclose on the form.
0
2417
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 order to be able to move that Form around with the mouse I have to implement EventHandlers for the MouseDown, MouseUp and MouseMove event. Now the problem I have is these Events will never be fired because the entire dialog is covered by the...
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7351
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.