With both events the same: Doesn’t maximize in Windows?
Last solution, if setting size doesn’t work, is setting Fullscreen …
FUNCTION Fullscreen(boSwitch AS BOOLEAN)
DIM oDispatcher AS OBJECT
DIM Props(0) AS NEW com.sun.star.beans.PropertyValue
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
Props(0).Name = "FullScreen"
Props(0).Value = boSwitch
oDispatcher.executeDispatch(ThisComponent.CurrentController.Frame, ".uno:FullScreen", "", 0, Props())
END FUNCTION
@JohnB47 :Try to execute the macro when form has already be opened. So we could see if the event is the reason. Try also with other values for width and height. Doesen’t it change the bahvior?