Inheriting from an abstract class with no constructor (trying to)...

S

SpotNet

Hi Newsgroup,

Reconstructing my common dialog assembly using C# 2.0 .NET Framework 2.0. I
have the following;

public class FileDialogBase: System.Windows.Forms.FileDialog
{
//No constructor seem to do me any justice....
}

No matter what I've been doing (in terms of the class constructors) I keep
getting the error;

The type 'System.Windows.Forms.FileDialog' has no constructors defined. Does
this mean I cannot inherit from this class despite it being abstract and not
tagged as sealed? Or,

Is there something here I haven't properly considered?

Many thanks Newsgroup for you consideration.

Regards,
-SpotNet
 
F

Frans Bouma [C# MVP]

SpotNet said:
Hi Newsgroup,

Reconstructing my common dialog assembly using C# 2.0 .NET Framework
2.0. I have the following;

public class FileDialogBase: System.Windows.Forms.FileDialog
{
//No constructor seem to do me any justice....
}

No matter what I've been doing (in terms of the class constructors)
I keep getting the error;

The type 'System.Windows.Forms.FileDialog' has no constructors
defined. Does this mean I cannot inherit from this class despite it
being abstract and not tagged as sealed? Or,

Is there something here I haven't properly considered?

Many thanks Newsgroup for you consideration.

From the documentation:
"FileDialog is an abstract class, and cannot be created directly.
Additionally, you cannot inherit from this class"

So you can't inherit from this class (i.e.: it has an internal
constructor).

FB

--
 
S

SpotNet

Thanks for the clarification Frans, I can now execute plan B. It also
reminds me to look up the documentation rather than the little notes you get
at the bottom right corner of the Object Browser. Thanks again Frans.

Regards,
SpotNet.
 

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