if I set Enable=false a form it is still selectable, resizable with mouse drag, and resizable by the title bar,
This do not happen in winform.
I need to emulate showdialog, without freeze all opened forms, then I use the following code extension, but there is the problem just described
this is the code of the extension
Public Sub ShowWithParentFormLock(ByVal childForm As Form, ByVal parentForm As Form)
ShowWithParentFormLock(childForm, parentForm, Nothing)
Public Sub ShowWithParentFormLock(ByVal childForm As Form, ByVal parentForm As Form, ByVal actionAfterClose As Action)
If (childForm Is Nothing) Then
Throw New ArgumentNullException("childForm")
If (parentForm Is Nothing) Then
Throw New ArgumentNullException("parentForm")
Dim activatedDelegate As EventHandler = Sub(sender, e)
AddHandler childForm.FormClosed, Sub(ByVal sender As Object, ByVal closedEventArgs As FormClosedEventArgs)
parentForm.Enabled = True
If (actionAfterClose IsNot Nothing) Then
RemoveHandler parentForm.Activated, activatedDelegate
RemoveHandler parentForm.GotFocus, activatedDelegate
If (Not childForm.IsDisposed OrElse Not childForm.Disposing) Then
Catch ex As Exception
AddHandler parentForm.Activated, activatedDelegate
parentForm.Enabled = False
This full solve the problem
think of a desktop wisej application and imagine there are many “applications”.
application1: invoice management
… and many others.
if just one of the applications shows a form with showdialog… all other applications will be locked.
I need that if an application shows a modal form, it is still possible to use other applications. This is what i need.
If I use TopMost, the parent form it is still focusable, and do not receive DialogResult, and other application can’t go over it.
“I need to emulate showdialog, without freeze all opened forms”
wouldn´t it be the easiest option to just use the TopMost property and set it to true for that window ?
Or maybe I misunderstood what you´re trying to achieve ?
Can you please clarify in that case ?
Thanks in advance.
Please login first to submit.