Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Enlarge one container image (OnSelect) where there's other images - apply this to all images but only when On Select

(0) ShareShare
ReportReport
Posted on by 34

Apologies this is probably really simple.

I have a container in which there are six images. I would like to enlarge whichever image has been clicked on whilst the other images remain the same. 

Thanks 

  • AARON_C Profile Picture
    2,233 Most Valuable Professional on at
    Re: Enlarge one container image (OnSelect) where there's other images - apply this to all images but only when On Select

    Hi @MrSheen,

     

    The easiest way would be to create a variable for each width and height property of each image. 

     

    OnSelect Property of the Image:

    // For Image 1
    If(Self.Width = 100,
     Set(gblWidth1, 200);
     Set(gblHeight1, 200),
     Set(gblWidth1, 100);
     Set(gblHeight1, 100)
    )
    // For Image 2
    If(Self.Width = 100,
     Set(gblWidth2, 200);
     Set(gblHeight2, 200),
     Set(gblWidth2, 100);
     Set(gblHeight2, 100)
    )

     

    In the Width and Height properties, it would be gblWidth1 & gblHeight1, etc.

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: Enlarge one container image (OnSelect) where there's other images - apply this to all images but only when On Select

    Hi @MrSheen ,

     

    Please try this

    vxiaochenmsft_0-1718242696956.png

    - Screen1:
     Control: Screen
     Children:
     - Container1:
     Control: GroupContainer
     Variant: manualLayoutContainer
     Properties:
     Height: =520
     Width: =1095
     X: =40
     Y: =40
     Children:
     - Image1:
     Control: Image
     Properties:
     OnSelect: =Set(SelectedImage,"Image1");
     Height: =If(SelectedImage="Image1",100+var,100)
     ImagePosition: =ImagePosition.Fill
     Width: =If(SelectedImage="Image1",100+var,100)
     - Image1_1:
     Control: Image
     Properties:
     OnSelect: =Set(SelectedImage,"Image2");
     Height: =If(SelectedImage="Image2",100+var,100)
     ImagePosition: =ImagePosition.Fill
     Width: =If(SelectedImage="Image2",100+var,100)
     X: =Image1.X+Image1.Width
     - Image1_2:
     Control: Image
     Properties:
     OnSelect: =Set(SelectedImage,"Image3");
     Height: =If(SelectedImage="Image3",100+var,100)
     ImagePosition: =ImagePosition.Fill
     Width: =If(SelectedImage="Image3",100+var,100)
     X: =Image1_1.X+Image1_1.Width
    

    vxiaochenmsft_1-1718242738287.png

     

    Best Regards,

    Wearsky

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard