Information générale
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement