elGringo Posted March 9, 2017 Share Posted March 9, 2017 Didn't find any method in UniGUI how to get browser width, so decided to ask it right from Sencha EXT JS and transport through AJAX MainForm > ClientEvents > OnActivate function window.activate(sender, eOpts) { var BrowserWidthValue=Ext.getBody().getViewSize().width; ajaxRequest(sender, 'GetBrowserWidth', [ 'BrowserWidth='+BrowserWidthValue, 'param1=B' ]); } In MainForm procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName='GetBrowserWidth' then begin FBrowserWidth:=Params.Values['BrowserWidth'].ToInteger; end; end; But I'm not sure if Activate is best event for this Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 9, 2017 Share Posted March 9, 2017 Hi, Also, you can use OnScreenResize event procedure TMainForm.UniFormScreenResize(Sender: TObject; AWidth, AHeight: Integer); begin // AWidth; // AHeight; end; Or UniApplication.ScreenWidth; UniApplication.ScreenHeight; http://forums.unigui.com/index.php?/topic/6156-how-to-get-the-client-screen-resolution/ Best regards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.