UliBru Posted October 25, 2012 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
TNT23 Posted August 22, 2013 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
asapltda Posted September 5, 2013 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
55143681 Posted February 11, 2020 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.
Kattes Posted September 4, 2020 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),
Recommended Posts