Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#2287 closed Bug (Fixed)

GUICtrlSetState($controlID, $GUI_ONTOP) Doesn't set on top

Reported by: jmon Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: z ordering Cc:


GUICtrlSetState($controlID, $GUI_ONTOP) Doesn't set the control on top of others. This constant doesn't seem to do anything.
The problem has been tested and discussed here:


#include <GUIConstantsEx.au3>

$GUI = GUICreate("Test", 800, 600)

$LABEL1 = GUICtrlCreateLabel("under", 20, 20, 500, 300)
GUICtrlSetBkColor(-1, 0xFF0000)
$LABEL2 = GUICtrlCreateLabel("above", 40, 60, 500, 300)
GUICtrlSetBkColor(-1, 0x00FF00)


Until GUIGetMsg() = -3

Attachments (0)

Change History (3)

comment:1 Changed 11 years ago by czardas

I searched hard to find a link I read about this recently. Although I couldn't find it, I I found this instead which may be more relevant.

"In Visual Basic 6.0, the ZOrder method was used to specify the layering of controls; in Visual Basic 2010 .it is replaced by the BringToFront and SendToBack methods. This function is used by the upgrade tools to map between the methods."

I'm not sure, but this may help to explain why $GUI_ONTOP appears to be not functioning.

comment:2 Changed 11 years ago by trancexx

  • Resolution set to No Bug
  • Status changed from new to closed

$GUI_ONTOP does what it's docummented that it does. There is no bug here.
Documentation says that control will get to the top of z-order. By default if the control is on top, it's the closest to the parent window (GUI) and it's therefore covered by all other controls being lower down the z-order.

On the other hand, for example, if the GUI would have WS_EX_COMPOSITED ex-style, you would see different effect (also docummented).

comment:3 Changed 10 years ago by Jon

  • Milestone set to
  • Owner set to Jon
  • Resolution changed from No Bug to Fixed

Fixed by revision [10301] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jon.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.