473,761 Members | 2,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Class Event Handlers and Overrides

I'm building a Web application but this question should be common to all C#
applications.

When I use a class, and I want to add event handlers or override base class
methods, how do I know the correct syntax for those methods?

In MFC, I can simply choose event handlers from a list and they are inserted
automatically with the correct signature. Similar deal with Visual Basic 6.
But I can't seem to find anything like this in C#.

Do I have to know the signature of every method I add or is there a hidden
feature for this somewhere? (Note: Double clicking a control is not an
option in this case as I'm currently trying to override a method in the base
class and/or finding out what methods are available in the base class.)

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Jan 7 '07 #1
4 3254
Are you using Visual Studio? It does this for you as you type. For example
with overrides, typing "override" will bring up all of the possible
overrides, for events typing the event handler you want then the += statement
will bring up the auto complete option. Make sure that the
Tools->Options->Text Editor->All Languages options have the "Parameter
Infomation" option checked.

Mark
--
http://www.markdawson.org
http://themightycoder.spaces.live.com
"Jonathan Wood" wrote:
I'm building a Web application but this question should be common to all C#
applications.

When I use a class, and I want to add event handlers or override base class
methods, how do I know the correct syntax for those methods?

In MFC, I can simply choose event handlers from a list and they are inserted
automatically with the correct signature. Similar deal with Visual Basic 6.
But I can't seem to find anything like this in C#.

Do I have to know the signature of every method I add or is there a hidden
feature for this somewhere? (Note: Double clicking a control is not an
option in this case as I'm currently trying to override a method in the base
class and/or finding out what methods are available in the base class.)

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Jan 7 '07 #2
Okay, thanks. I'm used to point and click but I guess I can type in override
and that seems to work okay.

Not sure the event tip helps me though because, just starting to move to
..NET, I don't really know what events are available. So I won't be typing
them in.

BTW, I notice the Class view tab is completely empty. In MFC, I can use that
to see what's what. Seems like that would be a nice addition to C#.

Thanks again.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Mark R. Dawson" <Ma*********@di scussions.micro soft.comwrote in message
news:6C******** *************** ***********@mic rosoft.com...
Are you using Visual Studio? It does this for you as you type. For
example
with overrides, typing "override" will bring up all of the possible
overrides, for events typing the event handler you want then the +=
statement
will bring up the auto complete option. Make sure that the
Tools->Options->Text Editor->All Languages options have the "Parameter
Infomation" option checked.

Mark
--
http://www.markdawson.org
http://themightycoder.spaces.live.com
"Jonathan Wood" wrote:
>I'm building a Web application but this question should be common to all
C#
applications .

When I use a class, and I want to add event handlers or override base
class
methods, how do I know the correct syntax for those methods?

In MFC, I can simply choose event handlers from a list and they are
inserted
automaticall y with the correct signature. Similar deal with Visual Basic
6.
But I can't seem to find anything like this in C#.

Do I have to know the signature of every method I add or is there a
hidden
feature for this somewhere? (Note: Double clicking a control is not an
option in this case as I'm currently trying to override a method in the
base
class and/or finding out what methods are available in the base class.)

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 8 '07 #3
Not sure the event tip helps me though because, just starting to move to
..NET, I don't really know what events are available. So I won't be typing
them in.
When you are in Visual Studio and have an object, when you type the period
(.) you will get a list of all the methods and events so you can see what is
available to you, which is very handy.
BTW, I notice the Class view tab is completely empty. In MFC, I can use that
to see what's what. Seems like that would be a nice addition to C#.
The class view will show you all of the namespaces and types in your
project, it should not be empty. Not sure what you mean by "what's what" but
another useful window if you have Visual Studio 2005 (not the express
editions) is the "Code Definition Window" which gives you information about
types / methods etc as you click on them, which is really great, I use this
alot.

Hope you have fun in the .Net world, it is definitely worth learning.

Mark
--
http://www.markdawson.org
http://themightycoder.spaces.live.com
"Jonathan Wood" wrote:
Okay, thanks. I'm used to point and click but I guess I can type in override
and that seems to work okay.

Not sure the event tip helps me though because, just starting to move to
..NET, I don't really know what events are available. So I won't be typing
them in.

BTW, I notice the Class view tab is completely empty. In MFC, I can use that
to see what's what. Seems like that would be a nice addition to C#.

Thanks again.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Mark R. Dawson" <Ma*********@di scussions.micro soft.comwrote in message
news:6C******** *************** ***********@mic rosoft.com...
Are you using Visual Studio? It does this for you as you type. For
example
with overrides, typing "override" will bring up all of the possible
overrides, for events typing the event handler you want then the +=
statement
will bring up the auto complete option. Make sure that the
Tools->Options->Text Editor->All Languages options have the "Parameter
Infomation" option checked.

Mark
--
http://www.markdawson.org
http://themightycoder.spaces.live.com
"Jonathan Wood" wrote:
I'm building a Web application but this question should be common to all
C#
applications.

When I use a class, and I want to add event handlers or override base
class
methods, how do I know the correct syntax for those methods?

In MFC, I can simply choose event handlers from a list and they are
inserted
automatically with the correct signature. Similar deal with Visual Basic
6.
But I can't seem to find anything like this in C#.

Do I have to know the signature of every method I add or is there a
hidden
feature for this somewhere? (Note: Double clicking a control is not an
option in this case as I'm currently trying to override a method in the
base
class and/or finding out what methods are available in the base class.)

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


Jan 8 '07 #4
Mark,
When you are in Visual Studio and have an object, when you type the period
(.) you will get a list of all the methods and events so you can see what
is
available to you, which is very handy.
Yeah, I'm familiar with that--it's the same as with Visual Basic 6 and MFC.
But when there's no visual object associated with a class you're inheriting
from, I don't view that as much help.
The class view will show you all of the namespaces and types in your
project, it should not be empty.
Yeah, well, after several hours of trying to learn to work with ADO.NET,
it's no surprise. I could fill a book with what should be but is not. The
Class View is completely empty for me.
Not sure what you mean by "what's what" but
another useful window if you have Visual Studio 2005 (not the express
editions) is the "Code Definition Window" which gives you information
about
types / methods etc as you click on them, which is really great, I use
this
alot.
Hmmm... Hadn't seen that one before. Didn't seem to do much at first glance.
I'll play with it a little more.
Hope you have fun in the .Net world, it is definitely worth learning.
Yes, I'm not new to programming by any stretch. I do feel the .NET
technology for Web sites is cool. But it's not as accessible as some
previous MS languages and working through ADO.NET, in particular the
connections and security, etc. is a royal PITA.
Baaaaaaaarrrrrr rrfffffffff!!!

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Jan 8 '07 #5

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

Similar topics

5
1540
by: Jon Paugh | last post by:
Is there a standard for where to put the different categories of code in a class file? For example, after the class declaration, normally I put class variables, then constuctor, then private methods, public methods, then properties etc. Is there a standard for this order? Anyone know of a good template in CodeSmith or in the MS VS template language that seperates the different pieces of code?
1
1452
by: Bingo | last post by:
Quick question, I'm new to C# and ASP.NET. Why do the OnInit, OnPreRender and other eventhandlers in the Page class only have (Eventargs) as the only argument? Isn't the signature of an event handler supposed to be (object, eventArgs)? My only guess is that these aren't being assigned via a delegate, but
3
4884
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
1
2033
by: seanmayhew | last post by:
I have a form page that that while editing saves the data to an xml doc before submitting to db. On each page unload it saves the xmldoc as the user can add multiple items to the company like product types etc. So for instance Im adding a fruit company while adding a fruit company I allow the user to add types of fruit they carry and display it dynamically using an <asp:table> with image
5
3164
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits CommonPageBase - Contains myPage which inherits PageBase Each of these classes overrides OnInit and ties an event handler
9
3349
by: Richard Brown | last post by:
Can anyone give me a good argument one way or another? I have an 'address' set of fields that are used in various situations (a client has an address, a destination has an address, etc). These fields are all normalized into a seperate database table from the client and destination tables. My question is, which is better to create, a User Control, or a generic class that will add controls to a form directly, applying its common event...
0
2997
by: Adam J. Schaff | last post by:
Hello. I have a custom collection that implements IBindingList (allownew and allowremove are both true). I have bound it to a datagrid. I have add and remove buttons on the screen. I want to implement those buttons, but I'm not sure what the code should look like. I tried what I thought was obvious code: myCollection.AddNew() and
7
4661
by: tshad | last post by:
I have a problem with a VS 2003 project. This project was designed and works fine in VS 2003. But trying to open the project I get the following error. ************************************************************ The class EmailPoller can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try...
5
1045
by: Andy B | last post by:
I want to have page level access to a certain object but cant figure out how to do this. I create a class method that returns the object, but I cant get it to be global to the page. By global to the page, I mean to let all methods and event handlers have access to the same instance of the object. I looked at a global.asax file, but that doesn't seem to be what I am looking for (since the object is supposed to be page wide not application...
0
9522
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
10111
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
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
9902
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
8770
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
7327
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
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.