cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
developer_13246
Frequent Visitor

Hide control on small screens

Hi,

 

I'm working with a split screen layout in a canvas app, and would like to hide leftsidecontainer on small screens.

 

leftsidecontainer contains an image, it is part of a login page, where the rightsidecontainer includes login buttons.

 

Question is: how can I hide a power apps control on small screens (a container, an image, or even a button)?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @developer_13246 set the width and height as variable for what you deem as a small screen.

{OnStart}

Set(smallScreen,{width: yourSmallScreenWidthValue, height: yourSmallScreenHightValue})

 

As an example i will use texboxes to show and hid a control, with width 126

rubin_boer_0-1634546341369.png

the rectangular's visible is set to Self.Width >= smallScreen.width

 

 

Lets set the with to smaller than 126 (120)

rubin_boer_2-1634546750901.png

 The rectanuglar contrl is not visble anymore.

 

Summary

Set your screen dimension for small screen

Set(smallScreen,{width: yourSmallScreenWidthValue, height: yourSmallScreenHightValue})

Set the visibiltiy of the control to Self.Width >= smallScreen.width || Self.Height >= smallScreen.height

 

Hope this helps

R

 

 

 

View solution in original post

2 REPLIES 2
rubin_boer
Super User
Super User

hi @developer_13246 set the width and height as variable for what you deem as a small screen.

{OnStart}

Set(smallScreen,{width: yourSmallScreenWidthValue, height: yourSmallScreenHightValue})

 

As an example i will use texboxes to show and hid a control, with width 126

rubin_boer_0-1634546341369.png

the rectangular's visible is set to Self.Width >= smallScreen.width

 

 

Lets set the with to smaller than 126 (120)

rubin_boer_2-1634546750901.png

 The rectanuglar contrl is not visble anymore.

 

Summary

Set your screen dimension for small screen

Set(smallScreen,{width: yourSmallScreenWidthValue, height: yourSmallScreenHightValue})

Set the visibiltiy of the control to Self.Width >= smallScreen.width || Self.Height >= smallScreen.height

 

Hope this helps

R

 

 

 

Works nicely as described, thank you @rubin_boer 🌞

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,992)