Jump to content

Recommended Posts

Posted

Hi all,

I need to use ControlMove() on some controls of a hidden GUI window.

This works properly on a GUI window created with default style, but does not work on a GUI window created with style $WS_OVERLAPPEDWINDOW

func GUItest($bOverlapped)
    $m = GUICreate("test", 200, 100, -1, -1, $bOverlapped ? $WS_OVERLAPPEDWINDOW : -1)
    $g = GUICtrlCreateButton("test", 0, 0)
    ControlMove($m, "", $g, 30, 30)
    GUISetState()
endfunc

GuiTest(false)  ; button 'test' properly moved to (30,30)
GuiTest(true)   ; button 'test' not moved and still sitting at (0,0)

Any reason for this unexpected behavior ?

Any workaround to fix this ?

Thanks for any help

Posted

OK, after some searches in bug reports... I can answer my own question :

For moving GUI controls, GUICtrlSetPos() should be used instead of ControlMove()

Using this function, the control is moved properly whatever window style.

Bug fixed.

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
×
×
  • Create New...