A quick tip from recent experience: If you're writing your own Windows Forms controls and trying to unit test them, data binding issues are likely to pop up at some point. When you put the controls on the form, data binding works like magic. But when you're instantiating the controls outside the form context, you suddenly realize data binding is totally dead. Whazzup?
It's all about binding context. Without going into details here, your controls need one. Normally, the form has a single binding context that gets set to all the controls on it (I think this happens during the autogenerated Controls.Add call in InitializeComponent, although I haven't really verified this). Well, just do a MyControl.BindingContext = new BindingContext(). If you need to simulate several controls that work together as if they were on the same form, assign the same BindingContext object to all of them.
thanks man - thanks so much!
Posted by: cseeger at April 28, 2005 05:31 AMazqdxtcs [URL=http://xmtpqfdt.com]ivduvcvz[/URL] ppbdwfqh http://cwmigqab.com ssqovnut kcoqozwj
Posted by: fzhrjpcr at January 1, 2007 12:53 AMThanks man...
This saved alot of headaches.