Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetActiveForm method
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
GetActiveForm method
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01226167
Message ID:
01226167
Vues:
59
I have a form based on mmBusinessForm and if I call the GetActiveForm method to get a reference to the active form, it work great. I can then create an instance of myBusiness Form class and call a form method like below:

Form ActiveFormObj = mmAppDesktop.MainForm.GetActiveForm();
dstBusinessForm BusinessForm = ActiveFormObj as dstBusinessForm;

if (BusinessForm != null)
{
BusinessForm.Search();
}

If I attempt to do the same thing for an mmMaintenanceForm like this:

dstMaintForm MaintForm = ActiveFormObj as dstMaintForm;

I get the following error:

Cannot convert type 'System.Windows.Forms.Form' to 'DST.Bassets.dstMaintForm' via a built-in conversion

How can I get a reference to the active form when it is a mmMaintenanceForm and then call a method from outide the form?

Thanks in advance for any help.

Kind Regards,

Mat
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform