Hi Luca,
thanks to the code you wrote in this thread, I have the complete solution
https://wisej.com/support/question/form-enabled-question#sabai-entity-content-8670
I have created an Extension, that do exactly what I ask.
Instead call
Form1,showdialog()
I call
Form1.ShowWithParentLock(me)
and the parent form is locked exactly like on the desktop, and all other forms are free
it’s work wery well!
this is the code (in the forum I must put ‘[]’ instead ‘<'):
if you want you can integrate wisej ShowDialog code with this, if it is useful
[Extension]
Public Sub ShowWithParentLock(ByVal childForm As Form, ByVal parentForm As Form)
ShowWithParentLock(childForm, parentForm, Nothing)
End Sub
''' [summary]
''' Emulate showdialog function, without freezing only the parent form
''' [/summary]
''' [param name="childForm"][/param]
''' [param name="parentForm"][/param]
''' [param name="actionAfterClose"][/param]
[Extension]
Public Sub ShowWithParentLock(ByVal childForm As Form, ByVal parentForm As Form, ByVal actionAfterClose As Action)
If (childForm Is Nothing) Then
Throw New ArgumentNullException("childForm")
End If
If (parentForm Is Nothing) Then
Throw New ArgumentNullException("parentForm")
End If
Dim activatedDelegate As EventHandler = Sub(sender, e)
childForm.Activate()
End Sub
AddHandler childForm.FormClosed, Sub(ByVal sender As Object, ByVal closedEventArgs As FormClosedEventArgs)
Try
parentForm.Eval("this.getBlocker().unblock();")
parentForm.Focus()
If (actionAfterClose IsNot Nothing) Then
actionAfterClose.Invoke
End If
Finally
Try
RemoveHandler parentForm.Activated, activatedDelegate
RemoveHandler parentForm.GotFocus, activatedDelegate
If (Not childForm.IsDisposed OrElse Not childForm.Disposing) Then
childForm.Dispose()
End If
Catch ex As Exception
End Try
End Try
End Sub
AddHandler parentForm.Activated, activatedDelegate
parentForm.Eval("this.getBlocker().setColor('null');
this.getBlocker().setBackgroundImage(null);
this.getBlocker().block();")
childForm.Show(parentForm)
End Sub
the only thing I don’t know how to do, is to wait until the code is executed
can you help me with this?
This full solve the problem
https://wisej.com/support/question/showdialog-parent-problem
regards
Cristian
Hi Luca,
thank you, your code solved more than my problems
continue in this thread that I put a solution 🙂
https://wisej.com/support/question/showdialog-parent-problem?tab=answers#sabai-questions-8664-add-answer
ciao
Cristian
The modal dialog (show dialog) and topmost and normal forms layers are different than local windows. These are not real windows, they are just <div> elements in the browser managed by a javascript WindowManager class. There is only the z-index that simulates the 3 “layers”: normal, modal and always on top. Most javascript framework only manage 1 layer, the page and modal. The modal is simulated in a browser by adding a blocker element that stops clicks to the elements below.
Wisej also manages normal windows opened after the modal, but it has to move them to the modal z-index range. That’s what you are seeing when closing the modal in between. There is no solution at the moment other than close the modal before opening a non-modal or make the non-modal modal.
Cannot reproduce with:
Application.Download(Application.MapPath(“MS Edge-26.png”), “TEST 1 2 3”);
I get “TEST 1 2 3” without +.
Yes, please send a test case showing the issue.
Try this:
protected override void OnEnabledChanged(EventArgs e) {
if (this.Enabled) {
this.Eval(@"
this.getBlocker().unblock();
");
} else {
this.Eval(@"
// removes the spinner image
// can change the color mask using this.getBlocker().setColor('green' or null);
this.getBlocker().setBackgroundImage(null);
this.getBlocker().block();
");
}
base.OnEnabledChanged(e);
}
Yes, I used method with second parameter. And I checked it in Chrome and Edge
Hi Huỳnh,
Printing without showing a PrintDialog is difficult to achieve across all browsers without installing extensions or changing settings in the browser. There are posts on StackOverflow explaining possible solutions to the issue through these methods and others.
I would recommend exploring the Google Cloud Print API or another similar API to see if you can achieve silent printing with that.
I’ve created a feature request to add a print() function to the PdfViewer control on Wisej! It’s logged as #1993.
Please let me know if I can help with anything else!
Best,
Levie
Hi Huynh,
I have logged issue #1992 for that problem.
Best regards
Frank
Hi,
thanks for reporting that issue.
I have logged it as #1991.
We´ll inform you when a fix is available.
Best regards
Frank
Hi Dmitry,
Are you using the second parameter of Application.Download(Path,DownloadName)?
What browser are you using?
Let me know!
Best regards,
Levie
ok I can set as movable=false and fixed the size,
but it is still selectable/focusable
Thanks for finding this bug. I’ve logged as issue #1989, and I’ll update this thread when it’s fixed.
Best regards,
Nick
Hi Hasan,
Could you be more specific on what control you’re looking at? If you’re looking for samples these might be helpful: https://github.com/iceteagroup/wisej-examples
Best,
Levie
Hi Cristian,
This looks to be the same behavior as WinForms. You could try two different things:
Solution #1 would be easier, but it’s entirely up to you.
Best,
Levie
Hi Antonio,
thanks for your interest in Wisej.
Yes, Gobal Variables are global for all users.
If you want to have session specific variables, please refer to the Application.Session object that can be used as a dictionary:
https://wisej.com/docs/2.0/html/Session.htm
Best regards
Frank
Hi Frank,
Thanks for the work-around, that will do for now.
Regards,
Mark
