Sign in to follow this  
Followers 0
E1M1

How to get curren XY location from $edit1?

3 posts in this topic

How do I get cursor's X and Y location on Edit1 control? I want display pos on msgbox

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 203, 146, 193, 125)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 185, 89)
GUICtrlSetData(-1, "Edit1")
$Button1 = GUICtrlCreateButton("get coords", 32, 112, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
        MsgBox(0,"Line:","Char:")   
    EndSwitch
WEnd

edited

Share this post


Link to post
Share on other sites



#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 203, 146, 193, 125)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 185, 89)
GUICtrlSetData(-1, "Edit1")
$Button1 = GUICtrlCreateButton("get coords", 32, 112, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $line = ControlCommand($Form1, "", $Edit1, "GetCurrentLine", "")
            $char = ControlCommand($Form1, "", $Edit1, "GetCurrentCol", "")
            MsgBox(0, "test", "Line:" & $line & @CRLF & "Char:" & $char)
    EndSwitch
WEnd

maybe.


Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Share this post


Link to post
Share on other sites

thanks, It's exactly what I need


edited

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  
Followers 0