Jump to content

Recommended Posts

Posted

Hi all guys,

I would like to create controls (basically inputbox, readonly, and labels) within a function. Is it possible to target a Gui Handle for this?
Something like:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=Y:\__ AutoIt\Form1.kxf
$Form1 = GUICreate("Form1", 405, 293, 302, 218)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=Y:\__ AutoIt\Form2.kxf
$Form2 = GUICreate("Form2", 405, 293, 800, 218)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $aInput[5]

Func _CreateControls() ; THEY ARE CREATED ON LAST GUI, CAN I SELECT THE GUI TO USE?
    Local $delta = 30
    ; Given actions, calculations, ...
    For $i = 0 to UBound($aInput)-1
        $aInput[$i] = GUICtrlCreateInput("Input" & $i, 8, 8+$delta*$i, 121, 21)
    Next
EndFunc

_CreateControls()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

As you can see Inputs are created on 2nd GUI. Is it possible to "target" function to specific GUI?

Thanks,

Marco

 

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...