开发者

Why is MDI parent occasionally not minimizing?

I have a MDI parent that opens another form like this:

Dim frm As New Form1
frm.ShowDialog(Me)

That form has a button that, when clicked, does this:

CreateObject("Shell.Application").ToggleDesktop()

The button operates as expected (showing the desktop) most of the time but occasionally does not minimize the MDI parent. All the other windows, including the开发者_运维技巧 form above get minimized every time.

Why is this happening, and how do I fix it?


Instead of trying to allow a form shown with ShowDialog I changed the angle from which I'm approaching. I'll show the form with Show and assign the MdiParent and just fake the modality of the form instead. The fake modal will disable all other parts of the MDI parent except the system buttons in the title bar. If the user attempts to close the MDI parent, the "modal" window will beep once and blink the title bar a bit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜