03-09-2018 10:03 AM - edited 02-04-2024 2:50 AM
Hello, on a document form I'm doing oForm.Freeze(true) and oForm.Freeze(false) and between them I open an other form (WinForms but it makes no difference) for asking user input. If user moves such form or other B1 forms over the freezed form, their layout remain stuck on the freezed form layout, causing a bad user experience.
How can I avoid this? Is there a way to keep the freezed form layout "refreshed", simply preserving its appearence?
Maybe you could use a modal form instead.
Freeze method is used when you want to update some stuff in the freezed form without let the user see the actions and without flickering
https://answers.sap.com/questions/452411/load-modal-form-with-loadbatchactions.html
Using a windows form
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow(); //THIS FUNCTION CAN STAY IN ANY PLACE YOU FIND APPROPRIATE
//THIS YOU CAN PUT IN YOUR BUTTON WHICH CALLS YOUR WINDOWS FORM
WindowWrapper oWindow = new WindowWrapper(ptr);
FormTest form = new FormTest();
Thread tr = new Thread(()=> form.ShowDialog(oWindow));
tr.SetApartmentState(ApartmentState.STA);
tr.Start();
public class WindowWrapper : System.Windows.Forms.IWin32Window
{
private IntPtr _hwnd;
// Property
public virtual IntPtr Handle
{
get { return _hwnd; }
}
// Constructor
public WindowWrapper(IntPtr handle)
{
_hwnd = handle;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Danilo, but our form that pops up is a WinForms, not a SAP UI form.
The aim, as you noted, is to open our form as modal, blocking user action on the SAP form. We are achieving this lanching our form on a different thread and freezing SAP form.
Can you see other ways to avoid the graphical problem (related to freezing) I pointed out?
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.