Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Explicitly executing parent code in the framework
Message
From
16/04/2008 17:02:05
Frank Dolinar
Mi House of Representatives
Michigan, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
MS SQL Server
Miscellaneous
Thread ID:
01310027
Message ID:
01311293
Views:
18
Hi, Kevin (and any lurking experts),

Since I'm attempting to access code in the modified mmMaintenanceForm in the Framework it appears to be a bit more complex than the approach you suggested, i.e. I'm still having some problems.
Here's what I know...

I have some very simple code in the mmMaintenanceForm in the Windows Forms project to call the mmButtonCancel.click method.
It's giving me errors.
Specifically I get the famous
"Object reference not set to an instance of an object"
when I click on the "Cancel" button on the form that the user sees.

The user form on which the "Cancel" button lives is a form derived from a custom form derived from the mmMaintenanceForm, which we have modified in the framework -- at your suggestion. The control 'mmbtnCancel' (declared in the mmMaintenanceForm code) is an object of the class 'mmButtonCancel'.

The code added into the mmMaintenanceForm for the mmButtonCancel is simple (I think), as shown below. There are several other bits that have been added to get the behavior we are looking for, all about the same level of complexity (as in "not very complex").


protected virtual void mmbtnCancel_Click( object sender, System.EventArgs e )
{
this.mmbtnCancel.PerformClick();
this.TabControlSelectedTab = this.tabSearch; // (aka this.ListPage)
}


What appears to be happening is that the reference from the user form to the 'mmbtnCancel_Click' method in the framework to execute the parent code isn't working, but I don't know why.

I strongly suspect that I'm simply missing something in how the call is supposed to be made to get through the several levels of button and form derivation.

Any advice / assistance will be much appreciated.

-Frank
Previous
Reply
Map
View

Click here to load this message in the networking platform