moving from vb.net to C#

  • Thread starter Thread starter Moebius
  • Start date Start date
M

Moebius

how do i override an event (e.g. Paint)??

i'm coding a class library and i want to do some things on the paint
event, which in visual basic .net sends a "e" parameter which
contains the Graphics object used to draw anything you want.

thanks in advance...
 
Use the override keyword.

In the example you mentioned, take the class view, select the base class method to override, right-click and click on 'Override'.

For eg;
class Base
{
public virtual void Paint()
{
...
}
}
class Derv : Base
{
public override void Paint()
{
...
}
}

HTH,
fbhcah
 
May be you want to do base.Paint();

Hopes that's help
ROM
www.familletaillandier.com

Moebius said:
how do i override an event (e.g. Paint)??

i'm coding a class library and i want to do some things on the paint
event, which in visual basic .net sends a "e" parameter which
contains the Graphics object used to draw anything you want.

thanks in advance...
 
Back
Top