![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Tue, Dec 18 2018 7:46 PM | Permanent Link |
KimHJ Comca Systems, Inc | I have a single web page with labels and Edit boxes,
I would like to have a different layout if a user uses a mobile device. Is it possible to have two layout with the same code and select the right one based on the device? If possible how would I do it? Thanks, Kim |
Tue, Dec 18 2018 10:34 PM | Permanent Link |
Raul ![]() | On 12/18/2018 7:46 PM, KimHJ wrote:
> I would like to have a different layout if a user uses a mobile device. > Is it possible to have two layout with the same code and select the right one based on the device? EWB does have a responsive layout but i assume you need more capability and separate UI. How do you want to differentiate between devices - based on screen size and/or some other criteria like mouse vs touch in terms of UI design ? You can definitely load forms based on detecting device type but there is bit extra work involved with code design - moving relevant code out into common shared units and using it there etc. > If possible how would I do it? A super simple way would be to just modify your project file source (menu Project->View Source) and then start whatever form is appropriate. For example a super simple example code could be something like this - it loads form frmSmall is browser window is less whathan 500 pixels wide or if it's Android or iOS device. You can create your own rules. begin Application.Title := 'My App'; Application.LoadProgress := False; if (Application.ViewPort.Width < 500) or (Application.isIos) or (Application.isAndroid) then begin Application.CreateForm(TFormSmall); Application.Run('frmSmall'); end else begin Application.CreateForm(TfrmLarge); Application.Run('frmLarge'); end; end. Raul |
Tue, Jan 8 2019 11:25 PM | Permanent Link |
KimHJ Comca Systems, Inc | >>Raul wrote:
For example a super simple example code could be something like this - it loads form frmSmall is browser window is less whathan 500 pixels wide or if it's Android or iOS device. You can create your own rules. begin Application.Title := 'My App'; Application.LoadProgress := False; if (Application.ViewPort.Width < 500) or (Application.isIos) or (Application.isAndroid) then begin Application.CreateForm(TFormSmall); Application.Run('frmSmall'); end else begin Application.CreateForm(TfrmLarge); Application.Run('frmLarge'); end; end.<< Thanks Raul just back from vacation. Kim |
This web page was last updated on Tuesday, February 11, 2025 at 11:58 AM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |