473,387 Members | 1,882 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,387 software developers and data experts.

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 3235
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*********@discussions.microsoft.comwrote in message
news:6C**********************************@microsof t.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 #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*********@discussions.microsoft.comwrote in message
news:6C**********************************@microsof t.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.
Baaaaaaaarrrrrrrrfffffffff!!!

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
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...
1
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...
3
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...
1
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...
5
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...
9
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...
0
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...
7
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....
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.