cancel
Showing results for 
Search instead for 
Did you mean: 

Other forms stick on a freezed form

bluish5
Explorer
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member233854
Active Contributor
0 Kudos

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

bluish5
Explorer
0 Kudos

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?

former_member233854
Active Contributor
0 Kudos

I updated the anwser