Nested classes...

mandelbrot

Centurion
Joined
Jul 1, 2005
Messages
194
Location
UK North East
Dear All,


I have developed a simple security class which contains a private nested class. This nested class displays a form on the screen at the users (programmers) request to obtain credentials from the end user. Is this good or bad practice, and if it's bad, then is there anyother way of declaring the form and still retaining its abstraction (the reason being I want the form to remain fixed and not be changed dynamically)?


Thanks in advance,
Paul.
 
Maybe I'd have to see your code, but you can certainly create a form from an abstract class that's not a nested class.

When you try and view a form in the designer and your form inherits from an abstract class, that will give you an error within Visual Studio. That error is because Visual Studio wants to instantiate the base class and can't because it's abstract. But that error is only in Visual Studio - at runtime you can still create your form (that inherits from the abstract class).

-ner
 
I see. But I thought, to display a form, I'd have to inherit from the Windows.Forms.Form class...

Hmmm... I'm just adding to what I've got at the moment, but I'll post the code shortly.

Thanks, Nerseus.
 
Back
Top