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

  • Thread starter Thread starter SpotNet
  • Start date Start date
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
 
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

--
 
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.
 
Back
Top