# Panels and Multithreading

You must discard a panel in the same thread in which you load or create it. Before a thread terminates, explicitly discard all panels you loaded or created in that thread.

If you create a child panel, you must do so in the same thread in which you create or load the top-level panel. You can create controls other than timer controls in any thread.

If you call InstallPopup on a panel, you must do so in the same thread in which you create or load the panel. The pop-up is modal only with respect to other panels you load or create in the same thread. You must call RemovePopup in the same thread.

You can call SetPanelPos and SetPanelSize on a top-level panel only in the thread in which you load or create it.

The following panel attributes, when applied to a top-level panel, can be set only in the thread in which you load or create the panel:

- ATTR_FLOATING
- ATTR_SIZABLE
- ATTR_MOVABLE
- ATTR_CAN_MINIMIZE
- ATTR_CAN_MAXIMIZE
- ATTR_CLOSE_ITEM_VISIBLE
- ATTR_SYSTEM_MENU_VISIBLE
- ATTR_TITLEBAR_VISIBLE
- ATTR_WIDTH
- ATTR_HEIGHT
- ATTR_TOP
- ATTR_LEFT
- ATTR_TITLE
- ATTR_HAS_TASKBAR_BUTTON

If you enable the ATTR_FLOATING attribute on a panel, the panel floats only with respect to panels that you load or create in the same thread.

| Note Keep in mind the restrictions mentioned in this topic whenever you create a DLL which displays one or more CVI panels; in particular, DLL functions that you call from different threads are affected by these restrictions.