S
Samuel R. Neff
I'm having weird results with a form that is already displayed modally
(via ShowDialog) displaying a second form via ShowDialog. The last
form is not modal even though it's called with ShowDialog.
For example, given three forms:
Startup
Pop1
Pop2
and this scenario:
Sub Main
Application.Run(new Startup())
End Sub
Class Startup
Sub Whatever
Dim f as new Pop1
f.ShowDialog()
End Sub
End Class
Class Pop1
Sub Whatever
Dim f as new Pop2
f.ShowDialog()
End Sub
End Class
I would expect that when Pop2 is displayed via the second ShowDialog
call, Pop2 should become modal as related to Pop1, but that's not the
case. Both forms Pop1 and Pop2 are modal as related to Startup but
clicking on Startup activates Pop1 and Pop1 is fully interactive.
I can work around the problem by disabling Pop1 before showing Pop2,
but it seems odd that I have to do that. Is there something I'm
misunderstanding about how ShowDialog works? Is there another,
better, workaround?
Thanks,
Sam
(via ShowDialog) displaying a second form via ShowDialog. The last
form is not modal even though it's called with ShowDialog.
For example, given three forms:
Startup
Pop1
Pop2
and this scenario:
Sub Main
Application.Run(new Startup())
End Sub
Class Startup
Sub Whatever
Dim f as new Pop1
f.ShowDialog()
End Sub
End Class
Class Pop1
Sub Whatever
Dim f as new Pop2
f.ShowDialog()
End Sub
End Class
I would expect that when Pop2 is displayed via the second ShowDialog
call, Pop2 should become modal as related to Pop1, but that's not the
case. Both forms Pop1 and Pop2 are modal as related to Startup but
clicking on Startup activates Pop1 and Pop1 is fully interactive.
I can work around the problem by disabling Pop1 before showing Pop2,
but it seems odd that I have to do that. Is there something I'm
misunderstanding about how ShowDialog works? Is there another,
better, workaround?
Thanks,
Sam