Déplace le point d'insertion à une position inter-caractères
#include <GuiRichEdit.au3>
_GUICtrlRichEdit_GotoCharPos ( $hWnd, $iCharPos )
$hWnd | Handle du contrôle |
$iCharPos | La position inter-caractères Valeur spéciale : -1 - la fin du texte |
Succès: | Retourne True. |
Échec: | Retourne False et définit @error <> 0. |
@error: | 101 - $hWnd n'est pas une handle 102 - $iCharPos n'est ni un nombre positif, ni zéro, ni -1 |
La première position inter-caractères du texte est 0.
Annule la sélection de texte (le cas échéant).
Consultez EM_EXSETSEL dans la librairie MSDN.
#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGui, $iMsg, $hRichEdit $hGui = GUICreate("Exemple (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "Ceci est un test.", 10, 10, 300, 220, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUISetState(@SW_SHOW) _GUICtrlRichEdit_SetText($hRichEdit, "Ceci est un test.") _GUICtrlRichEdit_GotoCharPos($hRichEdit, 8) While GUIGetMsg() <> $GUI_EVENT_CLOSE Wend _GUICtrlRichEdit_Destroy($hRichEdit) ; Nécessaire sauf si le script se bloque ; GUIDelete(); est OK aussi EndFunc ;==>Example