UliBru 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 comment Share on other sites More sharing options...
TNT23 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 comment Share on other sites More sharing options...
asapltda 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 comment Share on other sites More sharing options...
55143681 Posted February 12, 2019 Share Posted February 12, 2019 who has "window.OnResize"? Link to comment Share on other sites More sharing options...
55143681 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 comment Share on other sites More sharing options...
Kattes 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 comment Share on other sites More sharing options...
Recommended Posts