# Dynamic creation of toolbar with controls on main frame not showing, unless you minimize the window or open other window

**URL:** <https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073>\
**Category:** tips\
**Tags:** c11\
**Created:** [April 3, 2024, 7:00am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073 "2024-04-03T07:00:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xxetfxx](https://clarionhub.com/user_avatar/clarionhub.com/xxetfxx/32/5215_2.png) [@xxetfxx](https://clarionhub.com/u/xxetfxx)\
**Post date:** [April 3, 2024, 7:00am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073/1 "2024-04-03T07:00:16Z")

</div>

I have created a sample program, in which I encountered not showing toolbar and controls inside it when created unless you open a window or minimize the main window. What should be the cause and how to resolve this. Here’s a sample video

[dynbuttons.zip](https://clarionhub.com/uploads/short-url/iISAcfUwiYP2kiCoFj5XprpbTeh.zip) (726.6 KB)

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [April 3, 2024, 8:34am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073/2 "2024-04-03T08:34:28Z")

</div>

Hi,

I’m not sure why it doesn’t work, if it’s a bug or some kind of expected behaviour.

A quick if dirty fix. Declare a window structure like so

```auto
simpleWindow WINDOW(),AT(,,,)
             END

```

And then after your code to create and unhide the toolbar, add this code

```auto
OPEN(simpleWindow)
ACCEPT
  IF EVENT() = EVENT:OpenWindow
    BREAK
  END
END
CLOSE(simpleWindow)

```

Note: There may be a slight flicker.

I’d be interested to see if someone knows what’s going on.

Mark

---

<div class="post-metadata">

**Author:** ![xxetfxx](https://clarionhub.com/user_avatar/clarionhub.com/xxetfxx/32/5215_2.png) [@xxetfxx](https://clarionhub.com/u/xxetfxx)\
**Post date:** [April 3, 2024, 8:39am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073/3 "2024-04-03T08:39:36Z")

</div>

For now, this will do, Thanks a lot, Sir Mark. 😃

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [April 3, 2024, 8:53am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073/4 "2024-04-03T08:53:05Z")

</div>

I’m glad it will do, of course, another option, which would probably be my choice.

Add a toolbar to the frame with a hight of 0

```auto
TOOLBAR,AT(0,0,50,0),USE(?TOOLBAR1)
END

```

Then change your code where you currently create the toolbar to this

```auto
IF NOT ToolbarFeq
  ToolbarFeq = ?TOOLBAR1
  ToolbarFeq{PROP:Height} = 42
END

```

Mark

---

<div class="post-metadata">

**Author:** ![xxetfxx](https://clarionhub.com/user_avatar/clarionhub.com/xxetfxx/32/5215_2.png) [@xxetfxx](https://clarionhub.com/u/xxetfxx)\
**Post date:** [April 3, 2024, 10:34am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073/5 "2024-04-03T10:34:34Z")

</div>

I’ll try this and I will also try not destroying the toolbar whenever I try to refresh/update buttons

---

<div class="post-metadata">

**Author:** ![xxetfxx](https://clarionhub.com/user_avatar/clarionhub.com/xxetfxx/32/5215_2.png) [@xxetfxx](https://clarionhub.com/u/xxetfxx)\
**Post date:** [April 4, 2024, 1:31am UTC](https://clarionhub.com/t/dynamic-creation-of-toolbar-with-controls-on-main-frame-not-showing-unless-you-minimize-the-window-or-open-other-window/7073/6 "2024-04-04T01:31:04Z")

</div>

I tried not destroying the toolbar I created on run time and works the same as opening a dummy window. For now this will be a working solution. Thank you so much for helping.
