Jump to content
Sign in to follow this  
andybiochem

[SOLVED] Change order of label controls

Recommended Posts

andybiochem

Hi,

I'm sure there must be a simple way to do this, but I've tried everything I can think of.

All I want to do is change the order of how labels appear in the GUI.

example:

GUICreate("", 633, 454)

$Label1 = GUICtrlCreateLabel("", 96, 56, 188, 161)
GUICtrlSetBkColor(-1, 0x3A6EA5)
$Label2 = GUICtrlCreateLabel("", 200, 152, 236, 185)
GUICtrlSetBkColor(-1, 0xFFFF00)

GUISetState()
Do
    Sleep(10)
Until GUIGetMsg() = -3

How do I bring the blue label in front of the yellow one?... without destroying/recreating the labels, and without changing the order in which they are first created.

Thanks for any help!

Edited by andybiochem

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites
Authenticity

#include <Constants.au3>
#include <WinAPI.au3>

$hGUI = GUICreate("", 633, 454)

$Label1 = GUICtrlCreateLabel("", 96, 56, 188, 161)
$hLabel1 = GUICtrlGetHandle(-1)
GUICtrlSetBkColor(-1, 0x3A6EA5)
$Label2 = GUICtrlCreateLabel("", 200, 152, 236, 185)
$hLabel2 = GUICtrlGetHandle(-1)
GUICtrlSetBkColor(-1, 0xFFFF00)

GUISetState()
For $i = 1 To 5
    _WinAPI_SetWindowPos($hLabel1, $hLabel2, 0, 0, 0, 0, BitOR($SWP_NOMOVE, $SWP_NOSIZE))
    _WinAPI_InvalidateRect($hGUI)
    Sleep(200)
    _WinAPI_SetWindowPos($hLabel2, $hLabel1, 0, 0, 0, 0, BitOR($SWP_NOMOVE, $SWP_NOSIZE))
    _WinAPI_InvalidateRect($hGUI)
    Sleep(200)
Next

Do
    Sleep(10)
Until GUIGetMsg() = -3

Share this post


Link to post
Share on other sites
andybiochem

Superb! Thanks for the fast reply!


- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×