web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Enlarge one container ...
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 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    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

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    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 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 977

#2
Valantis Profile Picture

Valantis 664

#3
11manish Profile Picture

11manish 530

Last 30 days Overall leaderboard