# Detatched Dialog how to interact

**URL:** https://resource.dopus.com/t/detatched-dialog-how-to-interact/40032
**Category:** Help & Support
**Created:** [December 8, 2021, 6:01am UTC](https://resource.dopus.com/t/detatched-dialog-how-to-interact/40032 "2021-12-08T06:01:23Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Felix.Froemel](https://resource.dopus.com/user_avatar/resource.dopus.com/felix.froemel/32/68705_2.png) [@Felix.Froemel](https://resource.dopus.com/u/Felix.Froemel)
#### Post date: [December 9, 2021, 9:37am UTC](https://resource.dopus.com/t/detatched-dialog-how-to-interact/40032/5 "2021-12-09T09:37:56Z")

</div>

Have a look at my [SelectByDate command](https://resource.dopus.com/t/command-select-bydate-select-items-by-various-dates-and-parameters-update-v1-31-2021-10-30/39697) which uses a detached dialog.

I advise you to create variables for your dialog controls before going into the msg loop so that you can interact with them later on easily without always referencing the dialog

```auto
var Combo_Box_Alpha1 = dlg.Control("Combo_Box_Alpha1");
while(true) {
var val = Combo_Box_Alpha1.value;
...

```

You already did it the right way when printing the combo index.  
In the end you use `Control` without referencing the dialog. [Docs](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Control.htm) say

> Use the **[Dialog](https://www.gpsoft.com.au/help/opus12/Documents/Scripting/Dialog.htm).Control** method to obtain a **Control** object

---

_[View the full topic](https://resource.dopus.com/t/detatched-dialog-how-to-interact/40032)._
