Ciao a tutti.
Creo una semplice Form con dentro un controlTab per visualizzare dei dati che passo alla mia form con metodi set.
Una volta visualizzato il form, passando da una scheda all'altra velocemente, compare questa eccezione:
codice:
System.ComponentModel.Win32Exception non stata gestita
Message="Errore durante la creazione dell'handle della finestra."
Source="System.Windows.Forms"
ErrorCode=-2147467259 NativeErrorCode=8 StackTrace: in
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) in
System.Windows.Forms.Control.CreateHandle() in
System.Windows.Forms.TextBoxBase.CreateHandle() in
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) in
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) in
System.Windows.Forms.Control.CreateControl() in
System.Windows.Forms.Control.SetVisibleCore(Boolean value) in
System.Windows.Forms.TabPage.set_Visible(Boolean value) in
System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus) in
System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e) in
System.Windows.Forms.TabControl.WmSelChange() in
System.Windows.Forms.TabControl.WndProc(Message& m) in
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) in
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) in
System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) in
System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) in System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam) in
System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m) in
System.Windows.Forms.Control.WmNotify(Message& m) in
System.Windows.Forms.Control.WndProc(Message& m) in
System.Windows.Forms.ScrollableControl.WndProc(Message& m) in
System.Windows.Forms.ContainerControl.WndProc(Message& m) in
System.Windows.Forms.Form.WndProc(Message& m)
alla fine l'eccezione è sollevata qui:
visualizzaDati vS = new visualizzaDati();
try
{
vS.ShowDialog(); //<----
}
catch {}
posso risolvere meglio la cosa rispetto alla non gestione dell'eccezione che mi chiude la finestra bruscamente?
grazie