Jump to content
uniGUI Discussion Forums
UliBru

Mobile browser screen size

Recommended Posts

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

Share this post


Link to post
Share on other sites

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;

  • Upvote 1

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×