Hallo!
Weiß jemand von euch wie man mit AutoIt von einer EditBox die Linie in der man mit dem Cursor steht abfragen kann?
Danke
Hallo!
Weiß jemand von euch wie man mit AutoIt von einer EditBox die Linie in der man mit dem Cursor steht abfragen kann?
Danke
Hi
[autoit]#include <GuiEdit.au3>
[/autoit][autoit][/autoit][autoit]GUICreate("Test", 400, 400)
$hEdit = GUICtrlCreateEdit("Zeile 0" & @CRLF & "Zeile 1" & @CRLF & "Zeile 2" & @CRLF & "Zeile 3", 10, 10, 380, 380)
GUISetState()
_GUICtrlEdit_SetSel($hEdit, 0, 0)
While GUIGetMsg() <> -3
$iLine = _GUICtrlEdit_LineFromChar($hEdit)
ToolTip($iLine & @LF & _GUICtrlEdit_GetLine($hEdit, $iLine))
Sleep(50)
WEnd
lgE
Hmm vllt gibts noch ne bessere Lösung aber die hier geht auch:
#include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]$gui = GUICreate("Test", 300, 400)
$label = GUICtrlCreateLabel("Aktuelle Position:", 0, 0, 300)
$edit = GUICtrlCreateEdit("", 0, 20, 300, 380)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
[/autoit] [autoit][/autoit] [autoit]While 1
$array = _GUICtrlEdit_GetSel($edit)
$text = GUICtrlRead($edit)
$text = StringLeft($text, $array[0])
$split = StringSplit($text, @LF)
GUICtrlSetData($label, "Aktuelle Position des Zeigers: "&$array[0]&"-"&$array[1]&" Zeile: "&UBound($split)-1)
Sleep(100)
WEnd
Func _exit()
Exit
EndFunc
//EDIT: OK es gibt noch eine bessere Lösung THX eukalyptus
Danke genau so was habe ich gesucht!
Oder ganz ohne Includes:
[autoit]
$hGui = GUICreate("Test", 400, 400)
$hEdit = GUICtrlCreateEdit("Zeile 0" & @CRLF & "Zeile 1" & @CRLF & "Zeile 2" & @CRLF & "Zeile 3", 10, 10, 380, 380)
GUISetState()
While GUIGetMsg() <> -3
ToolTip(ControlCommand($hGui, '', $hEdit, "GetCurrentLine", ""))
WEnd
Oscar bei deiner Lösung flackert der Mauscursor aber wie blöde,wenn man sich innerhalb des Edit´s befindet .
Bei mir (WinXP) nicht!
Das mit dem Tooltip sollte ja sowieso nur ein Beispiel sein. Er will ja nur die Zeile wissen.
Stimmt liegt am Tooltip.