Skip to Content
0

Other forms stick on a freezed form

Mar 09 at 10:03 AM

20

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Danilo Kasparian Mar 09 at 01:28 PM
0

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;
		}
	}

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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?

0

I updated the anwser

0