最近我决定将WeifenLuo DockPanel Suite应用到我的VB.NET应用程序中。一切正常,直到你尝试关闭应用程序,然后冻结。没有任何事情发生。
我试过了:
但仍然没有,仍然只是冻结。
输出显示以下消息:
The thread 0x1f34 has exited with code 259 (0x103).
The thread 0x22b8 has exited with code 259 (0x103).
每次线程名称都不同。但是我没有运行任何线程。
这只发生在带有DockPanel的表单上。
有什么想法?我在网上找不到其他人这个问题,这真是令人沮丧。
感谢。
答案 0 :(得分:0)
In the form closing event of my application, I iterated through any open documents in the DockPanel using:
While i < DockPanel1.ActiveDocumentPane.Contents.Count
Dim dockContent As IDockContent = DockPanel1.ActiveDocumentPane.Contents(i)
dockContent.DockHandler.Close()
End While
This is what was causing the application to freeze. To fix this, I replaced the code with this:
For Each item As DockContent In DockPanel1.Documents
item.DockHandler.Close()
Next