# How to hide a htmlDialog?

**URL:** <https://forums.sketchup.com/t/how-to-hide-a-htmldialog/153855>\
**Category:** Ruby API\
**Created:** [February 18, 2021, 3:31am UTC](https://forums.sketchup.com/t/how-to-hide-a-htmldialog/153855 "2021-02-18T03:31:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry12](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@Henry12](https://forums.sketchup.com/u/Henry12)\
**Post date:** [February 18, 2021, 3:31am UTC](https://forums.sketchup.com/t/how-to-hide-a-htmldialog/153855/1 "2021-02-18T03:31:36Z")

</div>

For htmlDialog, there are bring\_to\_front and show methods, but no bring\_to\_back or hide methods. How can I hide a htmlDialog, in order to make it shown later on.

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [February 18, 2021, 6:47am UTC](https://forums.sketchup.com/t/how-to-hide-a-htmldialog/153855/2 "2021-02-18T06:47:42Z")

</div>

> [@Henry12](#):
>
> no bring\_to\_back or hide methods

That is true. But for example:

1. You can use  
`:style => UI::HtmlDialog::STYLE_WINDOW`  
in [#initialize method](https://ruby.sketchup.com/UI/HtmlDialog.html#initialize-instance_method) Options Hash (properties), so the HtmlDialog can go behind SketchUp _“automatically”_ and doesn’t disappear when SketchUp looses focus. Then you can [#bring\_to\_front](https://ruby.sketchup.com/UI/HtmlDialog.html#bring_to_front-instance_method) when you want.

* * *

1. You can [#close](https://ruby.sketchup.com/UI/HtmlDialog.html#close-instance_method) it, but _before_ you are doing that you have to take care to save the last state using the [#set\_on\_closed method](https://ruby.sketchup.com/UI/HtmlDialog.html#set_on_closed-instance_method), therefore you will be able to restore the state when you show it again later

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [February 18, 2021, 6:25pm UTC](https://forums.sketchup.com/t/how-to-hide-a-htmldialog/153855/3 "2021-02-18T18:25:07Z")

</div>

… and with (2) you must reattach any action callback blocks if you show the dialog object again.
