G
Guest
Hey guys,
I'm having some weird issues when calling Dispose on one of the controls in
a user control from an asycn or sync method. When called form an async
method Dispose makes a call to SelectNextControl but not when called from a
sync method. I'm trying to figure out why that is so.
Does anyone know under what conditions Dispose will call SelectNextControl?
I have a breakpoint set on the user controls OnValidated method and when the
dispose is called async I see the below stack trace. When called sync the
breakpoint is not hit (since the user control doesn't lose focus from a
SelectNextControl call).
Here is a sample stack trace:
system.windows.forms.dll!System.Windows.Forms.Control::Select(bool directed
= true, bool forward = true) + 0x32 bytes
system.windows.forms.dll!System.Windows.Forms.Control::SelectNextControl(System.Windows.Forms.Control
ctl = {Controls.Common.AmountControl}, bool forward = true, bool tabStopOnly
= true, bool nested = true, bool wrap = false) + 0xba bytes
system.windows.forms.dll!System.Windows.Forms.ContainerControl::Select(bool
directed = true, bool forward = true) + 0x9d bytes
system.windows.forms.dll!System.Windows.Forms.Control::SelectNextControl(System.Windows.Forms.Control
ctl = {Quote.Controls.QuoteControlAdv}, bool forward = true, bool tabStopOnly
= true, bool nested = true, bool wrap = true) + 0xba bytes
system.windows.forms.dll!System.Windows.Forms.ContainerControl::AfterControlRemoved(System.Windows.Forms.Control
control = {Calendar.Controls.PopupCalendar}) + 0x186 bytes
system.windows.forms.dll!System.Windows.Forms.Control::ControlCollectionRemove(System.Windows.Forms.Control
value = {Calendar.Controls.PopupCalendar}) + 0x102 bytes
system.windows.forms.dll!System.Windows.Forms.Control:ispose(bool
disposing = true) + 0x1db bytes
system.windows.forms.dll!System.Windows.Forms.ContainerControl:ispose(bool
disposing = true) + 0x2f bytes
I'm having some weird issues when calling Dispose on one of the controls in
a user control from an asycn or sync method. When called form an async
method Dispose makes a call to SelectNextControl but not when called from a
sync method. I'm trying to figure out why that is so.
Does anyone know under what conditions Dispose will call SelectNextControl?
I have a breakpoint set on the user controls OnValidated method and when the
dispose is called async I see the below stack trace. When called sync the
breakpoint is not hit (since the user control doesn't lose focus from a
SelectNextControl call).
Here is a sample stack trace:
system.windows.forms.dll!System.Windows.Forms.Control::Select(bool directed
= true, bool forward = true) + 0x32 bytes
system.windows.forms.dll!System.Windows.Forms.Control::SelectNextControl(System.Windows.Forms.Control
ctl = {Controls.Common.AmountControl}, bool forward = true, bool tabStopOnly
= true, bool nested = true, bool wrap = false) + 0xba bytes
system.windows.forms.dll!System.Windows.Forms.ContainerControl::Select(bool
directed = true, bool forward = true) + 0x9d bytes
system.windows.forms.dll!System.Windows.Forms.Control::SelectNextControl(System.Windows.Forms.Control
ctl = {Quote.Controls.QuoteControlAdv}, bool forward = true, bool tabStopOnly
= true, bool nested = true, bool wrap = true) + 0xba bytes
system.windows.forms.dll!System.Windows.Forms.ContainerControl::AfterControlRemoved(System.Windows.Forms.Control
control = {Calendar.Controls.PopupCalendar}) + 0x186 bytes
system.windows.forms.dll!System.Windows.Forms.Control::ControlCollectionRemove(System.Windows.Forms.Control
value = {Calendar.Controls.PopupCalendar}) + 0x102 bytes
system.windows.forms.dll!System.Windows.Forms.Control:ispose(bool
disposing = true) + 0x1db bytes
system.windows.forms.dll!System.Windows.Forms.ContainerControl:ispose(bool
disposing = true) + 0x2f bytes