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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Enlarge one container ...
Power Apps
Unanswered

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard