Skip to main content

Notifications

Community site session details

Community site session details

Session Id : y/7w4F5uY3OKR59y9JuY2e
Power Apps - Building Power Apps
Answered

Changing height of component with a button inside the component

Like (0) ShareShare
ReportReport
Posted on 24 Apr 2024 08:52:15 by 19

Hello,

 

I'm in the progress of doing my first component.

 

Inside the component I have a button and a gallery. When you click the button it should switch the height of the component between two values. I'm planning of using several instances of this component so they have to be controlled individually. 

 

How can I do this?

 

Thanks in advance,

Sebastian

  • Maister Profile Picture
    19 on 25 Apr 2024 at 06:30:54
    Re: Changing height of component with a button inside the component

    Hi @v-bofeng-msft ,

     

    Thank you! That was all the info I needed.

  • Verified answer
    v-bofeng-msft Profile Picture
    on 24 Apr 2024 at 09:23:23
    Re: Changing height of component with a button inside the component

    Hi  @Maister , 

     

    I've made a test for your reference:
    1\Set button1's OnSelect property to:

    Set(SelfHeight,400)

    2\Set button2's OnSelect property to:

    Set(SelfHeight,800) 

    3\Create a new output property CustomProperty1

    vbofengmsft_5-1713950451564.png

    4\Set it's value to

    SelfHeight
    vbofengmsft_6-1713950467199.png

    5\Set the component's Height property to

    Max(400,Self.CustomProperty1)
    vbofengmsft_7-1713950479011.png
    6\Result
    vbofengmsft_8-1713950500932.pngvbofengmsft_9-1713950508135.png

     

     

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started