Overriding Methods

  • Thread starter Thread starter arlef
  • Start date Start date
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
 
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.
 
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
 
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
 
Millions of thanks guy,
It worked with typing "override" followed by hitting the space key.
 
Back
Top