[Mono-bugs] [Bug 355850] Exception when disposing form trying to set focus on control

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 28 22:43:43 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=355850

User albright at wesay.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=355850#c2





--- Comment #2 from Eric Albright <albright at wesay.org>  2008-01-28 20:43:43 MST ---
Created an attachment (id=192096)
 --> (https://bugzilla.novell.com/attachment.cgi?id=192096)
Test program to reproduce bug

In tracing the root of the problem so that I could create a test case, it looks
as though the TabControl.SelectedIndex.set sets the Visible property of the
TabPage to false. Then, when the control inside of the TabPage is disposed,
removing it from it's parent, causes its Visible property to now be true
(instead of false which it was inheriting). This triggers an
ScrollableControl.OnVisibleChanged which then calls Control.OnVisibleChanged.
Since it is now Visible, it calls Control.CreateControl and creates a new
control causing Load to be called. In my code, I set the focus in the OnLoad
which then causes the problem.

A breakpoint in Mono355850.TestControl.OnLoad should show this.

Hope that helps.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list