# How to Automatically Close Previous UI Button When Clicking a New One?

**URL:** <https://forums.unrealengine.com/t/how-to-automatically-close-previous-ui-button-when-clicking-a-new-one/1940808>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [July 17, 2024, 3:46pm UTC](https://forums.unrealengine.com/t/how-to-automatically-close-previous-ui-button-when-clicking-a-new-one/1940808 "2024-07-17T15:46:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sepid\_ar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sepid\_ar](https://forums.unrealengine.com/u/Sepid_ar)\
**Post date:** [July 17, 2024, 3:46pm UTC](https://forums.unrealengine.com/t/how-to-automatically-close-previous-ui-button-when-clicking-a-new-one/1940808/1 "2024-07-17T15:46:01Z")

</div>

Hi everyone,

I’m working on a user interface in Unreal Engine and currently facing an issue. I have multiple UI buttons, and when I click one button, I have to manually click again to close the previous button. I’m looking for a way to automatically close the previously opened button when a new one is clicked.

Here’s a brief overview of my setup:

- Each button opens a new UI element when clicked.
- The previous UI element remains open until I click it again to close it.

How can I set up my UI so that clicking a new button automatically closes the previously opened UI element? Any guidance, tutorials, or examples would be greatly appreciated!

Thanks in advance!
