Question : this.name in the base class of a windows form

Hi

I have a form based on a system of base classes:

public partial class frmReservations : MerozManage.frmFormLookUpGrid

When I check this.name while debugging in one of the base classes I see "frmReservations"
I then made an inheritance from it:

public partial class frmReservationsClerk : MerozManage.Forms.frmReservations
    {
        public frmReservationsClerk():base("Clerks")
        {
             
            InitializeComponent();
        }
    }

I had to pass a parameter to frmreservations "public frmReservationsClerk():base("Clerks")"
Now when I check the same place while debugging this.name is "frmReservations" instead of "frmReservationsClerk" (which I want it to be).  

How do I insure that in the upper base class i will see the current name instead of its fatther's name?


Answer : this.name in the base class of a windows form

The name of a form isn't based on the class name. Somewhere the Name property of the base class is being set (possibly via a designer) and because you inherit from it your form also inherits then name. So, if it needs to be something different then you need to change it manually (as I said, this would usually be done at design time, but it depends on how you are managing your forms to an extent).
Random Solutions  
 
programming4us programming4us