Jump to content

Recommended Posts

How do I move a control?

I tried:

GUISetControlEx($label_2, 0, 2)

and

GUISetControlEx($label_2, 0, 2)

But they don't move the control.

Here's the script I was testing.

Opt ("GUICoordMode", 1)
Opt ("GUINotifyMode", 1)

GUICreate("Test", 250, 200, -1, -1)

$Line = ""
For $i = 1 To 25
   $Line = $Line & Chr(186)
Next

$label_1 = GUISetControl("label", "Today", 20, 20, 70)
$label_2 = GUISetControl("label", $Line, 20, 40, 70, 10)
GUISetControlFont($label_2, 8, 400, "Arial")
GUISetControlEx($label_2, 0, 0, "", 0x000000, 0xffffff)

GUIShow()

$GUI_DOCKLEFT = 2
$GUI_DOCKRIGHT = 4

$align = "left"

While 1
   Sleep(100)
   $msg = GUIMsg()
   Select
      Case $msg = -3
         GUIDelete()
         Exit

      Case $msg = $label_1
         If $align = "left" Then
            GUISetControlEx($label_2, 0, $GUI_DOCKLEFT)
            $align = "right"
         Else
            GUISetControlEx($label_2, 0, $GUI_DOCKRIGHT)
            $align = "left"
         EndIf

   EndSelect
WEnd
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...