Overriding Methods

A

arlef

Hi,
Is there a wizard or something that helps with overriding methods? For
Instance, I want to override the paint method of a Windows.Forms.Panel. do
I have to manually type the override paint method?

Regards
Jame
 
J

Jon Skeet [C# MVP]

arlef said:
Is there a wizard or something that helps with overriding methods? For
Instance, I want to override the paint method of a Windows.Forms.Panel. do
I have to manually type the override paint method?

IIRC, you can just hit Ctrl-Space when in the derived type but outside
any other method, select the Paint method, and VS.NET will generate the
appropriate things for you.

If that doesn't work, type "override" and I think a list will come up.
 
G

Galcho[MCSD.NET]

waht do you mean?
VS helps you as you typing method declaration.
when you type keyword ovverides and press space it shows you all
virtual methods from base class that you can override

hope ths helps
Galin Iliev[MCSD.NET]
www.galcho.com
 
B

Barry Kelly

arlef said:
Is there a wizard or something that helps with overriding methods?

Visual Studio 2005 intellisense does. Position your cursor inside the
class and type "override " (with a space at the end), and a listbox
should pop up listing all the virtual methods. Select one and the
declaration, with appropriate visibility, along with braces will pop up.
I have to manually type the override paint method?

If you type "override Paint" (so that "Paint" gets selected in the
dropdown) and press Enter, it'll fill out automatically.

-- Barry
 
A

arlef

Millions of thanks guy,
It worked with typing "override" followed by hitting the space key.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top