Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ImmBinding interface implementation
Message
 
À
18/12/2003 16:03:02
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00860193
Message ID:
00860882
Vues:
27
Nathan,

>This fixed the problem. It also introduces a bug/feature where no instance of a control can have the same name as it's class. This is good practice anyway, I guess...
>
>Is this a good work-around, or will this introduce problems that I haven't foreseen?

I've got an alternate solution that doesn't have this "bug/feature". Try this code instead (it's a partial method as was yours):
if (control is Control)
{
	// Try to use the control's built-in FindForm method to get the parent form
	Control UIControl = (Control)control;
	ParentForm = UIControl.FindForm();

	// If FindForm didn't work, check if the control is being instantiated, 
	// which means the best bet is to get the last instantiated form
	if (ParentForm == null && !UIControl.Created)
	{
		CheckActiveForm = false;
	}
}
Let me know how this works for you!

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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform