Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ImmBinding interface implementation
Message
 
To
18/12/2003 16:03:02
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00860193
Message ID:
00860882
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform