UliBru 0 Posted October 25, 2012 Share Posted October 25, 2012 Is there a way to get information about the available screen size or panel of a browser? The size may change with different mobile phones and for sure with a desktop browser. The information should be available during web form creation already to allow a layout adaption to the actual size. BR Uli Link to post Share on other sites
TNT23 20 Posted August 22, 2013 Share Posted August 22, 2013 You can use ClientEvents->ExtEvents->OnResize function window.OnResize(sender, width, height) { ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] ); } And do what ever you want in the form implementing OnAjaxEvent of the form procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if(EventName='screensize') Then Caption:=Params.Values['width']; End; 1 1 Link to post Share on other sites
asapltda 14 Posted September 5, 2013 Share Posted September 5, 2013 Hello, 1. When the user zooms in on the screen as I can capture the event? I 2.How I can do zoom by code ? tks Link to post Share on other sites
55143681 15 Posted February 12, 2019 Share Posted February 12, 2019 who has "window.OnResize"? Link to post Share on other sites
55143681 15 Posted February 11, 2020 Share Posted February 11, 2020 On 8/22/2013 at 11:25 PM, TNT23 said: You can use ClientEvents->ExtEvents->OnResize function window.OnResize(sender, width, height) { ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] ); } And do what ever you want in the form implementing OnAjaxEvent of the form procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if(EventName='screensize') Then Caption:=Params.Values['width']; End; Does not have effect. Link to post Share on other sites
Kattes 31 Posted September 4, 2020 Share Posted September 4, 2020 On 8/22/2013 at 5:25 PM, TNT23 said: You can use ClientEvents->ExtEvents->OnResize function window.OnResize(sender, width, height) { ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] ); } And do what ever you want in the form implementing OnAjaxEvent of the form procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if(EventName='screensize') Then Caption:=Params.Values['width']; End; This still is working perfectly (at least for mobile applications), Link to post Share on other sites
Recommended Posts