FlatStyle.System
olarak ayarlanır
System.ObjectDisposedException
System.ObjectDisposedException
Ben ebeveyn bir düğmeye tıklayarak üzerinde gösterir bir çocuk formu ettik . Ve kod aşağıdakine benzer.
Public Class Parent
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub btnOpenChild_Click(sender As Object, e As EventArgs) Handles btnOpenChild.Click
Child.Show()
End Sub
End Class
Çocuk formu, kendisini kapatan bir düğmeye sahip.
Public Class Child
Private Sub btnCloseMe_Click(sender As Object, e As EventArgs) Handles btnCloseMe.Click
Me.Close()
End Sub
End Class
Adımlar istisna almak için: Hata ayıklama modunda
- , Sonra çocuğun yakın butonuna tıklayın
Me.Close()
- bir kesme noktası koymak. kırılma noktası açık not defteri isabet ve çözüme
- Comeback üzerinde
- ardından devam
İstisna: düğme stili FlatStyle.System
ayarlandığında
System.ObjectDisposedException was unhandled
HResult=-2146232798
Message=Cannot access a disposed object.
Object name: 'Button'.
Source=System.Windows.Forms
ObjectName=Button
StackTrace:
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.PointToScreen(Point p)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication2.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
, herkes bir fikri yok mu bu açıkça geliyor
Bu uygulama veya bir soruna neden mi sadece merak? –
Gerçek zamanlı uygulamamda yakın tıkla, 10 ila 15 saniye arayla devam eden uzun bir çalışma süreci var. Bu arada kullanıcı not defteri veya kelime belgesi veya krom gibi başka bir uygulamayı tıklarsa bu hata ortaya çıkar. –
Hata ayıklama UI, bunun gibi sorunlara neden olması için bir engele sahiptir. Bir hata ayıklayıcı kendi içinde olayların farklı şekilde ateşlenmesine yol açıyor, odaklanma ve boyama olaylarına neden olabilir. Bu durumda, başka bir işlemi aktif hale getirmek tetikleyicidir. Düğmeler için kritik olan Capture özelliği ile ilgili bir şey olduğunu varsayalım. Aşırı durumlarda uzak hata ayıklayıcının kullanılması gerekebilir, böylece hata ayıklayıcının kendisi UI'yi etkilemez. Bu, böyle bir aşırı durum değildir, sadece Not Defteri başlamıyor geçici çözümdür. Sadece motora devam et. –