Modify

Opened 13 years ago

Closed 13 years ago

Last modified 14 months 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 (4)

comment:1 by czardas, 13 years ago

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 by trancexx, 13 years ago

Resolution: No Bug
Status: newclosed

$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 by Jon, 12 years ago

Milestone: 3.3.13.2
Owner: set to Jon
Resolution: No BugFixed

Fixed by revision [10301] in version: 3.3.13.2

comment:4 by Cornwell.Christopher@…, 14 months ago

After a Control is hidden, I’ve been able to get it to raised to the highest the z-order using this code:

GUICtrlSetState($LABEL1,BitOR( $GUI_ONTOP,$GUI_SHOW))

I finally found the answer after three years. There are other controls that have this similar situation where you need to BitOR two different states. I think BitOR($GUI_ENABLED,$GUI_CHECKED), I don’t remember exactly.

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.