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
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01226167
Message ID:
01226842
Vues:
11
Mat,

>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?

I probably need to look at your computer to see what's going on, because this should work (I just tried an example myself). I responded to your private e-mail so we'll coordinate a time when we can get together.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform