Jump to content

Recommended Posts

Posted

hi

I am trying to create a script what does a function when i click on a input in my GUI

I tried things as: GUICtrlGetState and GUISetAccelerators but no succeed

it will be something simple that I have not seen in the helpfile

I have search the forum but I found nothing

Greets

Daan

Posted

hi

I am trying to create a script what does a function when i click on a input in my GUI

I tried things as: GUICtrlGetState and GUISetAccelerators but no succeed

it will be something simple that I have not seen in the helpfile

I have search the forum but I found nothing

Greets

Daan

I might be that you just need to know what to search for.

If you just want something to happen when you click in an input then maybe something like this.

#include <GUIConstantsEx.au3>



Example()

Func Example()
    Local $file, $btn, $msg, $ip1

    GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
    $file = GUICtrlCreateInput("", 10, 5, 300, 20)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    $ip1 = GUICtrlCreateInput("", 10, 35, 300, 20)  ; will not accept drag&drop files
    $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)

    GUISetState()

    $msg = 0
    While $msg <> $GUI_EVENT_CLOSE
        $msg = GUIGetMsg()
        Select
            Case $msg = $btn
                ExitLoop
            Case $msg = $GUI_EVENT_PRIMARYDOWN
                $ci = GUIGetCursorInfo()
                If IsArray($ci) Then
                    If $ci[4] = $ip1 or $ci[4] = $file Then
                        MsgBox(262144, "hey", "that's an input you clicked in!")
                    EndIf
                EndIf
                
        EndSelect
        
        
    WEnd

 
EndFunc ;==>Example
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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