Modify

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#2287 closed Bug (Fixed)

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

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

Description

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:http://www.autoitscript.com/forum/topic/146182-solved-change-z-ordering-of-controls/#entry1034615

Example:

#include <GUIConstantsEx.au3>

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

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

GUICtrlSetState($LABEL1, $GUI_ONTOP)

Do
Sleep(50)
Until GUIGetMsg() = -3
Exit

Attachments (0)

Change History (3)

comment:1 Changed 5 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.

http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.compatibility.vb6.support.zorder%28v=vs.100%29.aspx

"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 5 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 3 years ago by Jon

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

Fixed by revision [10301] in version: 3.3.13.2

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

Action
as closed The owner will remain Jon.
Author


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

 
Note: See TracTickets for help on using tickets.