nobbitry Posted December 31, 2016 Share Posted December 31, 2016 Hi, I'm using v3.3.14.2 and have a Problem with _GUICtrlRichEdit_HideSelection. It doesn't seem to work (it doesn't hide the selection). At the moment I help myself with a ControlSend to hide my previous selection, but I hope that isn't necessary. That's the example from the help. expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Global $g_idLblMsg, $g_hRichEdit Example() Func Example() Local $hGui, $iMsg, $idBtnNext, $iStep = 0 $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 320, 350, -1, -1) $g_hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) $g_idLblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60) $idBtnNext = GUICtrlCreateButton("Next", 270, 310, 40, 30) GUISetState(@SW_SHOW) _GUICtrlRichEdit_SetText($g_hRichEdit, "First paragraph") While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($g_hRichEdit) ; needed unless script crashes ; GUIDelete() ; is OK too Exit Case $iMsg = $idBtnNext $iStep += 1 Switch $iStep Case 1 _GUICtrlRichEdit_SetSel($g_hRichEdit, 2, 5) Report("Text is selected") Case 2 _GUICtrlRichEdit_HideSelection($g_hRichEdit, True) Report("Selection is hidden") Case 3 _GUICtrlRichEdit_HideSelection($g_hRichEdit, False) Report("Selection is not hidden") GUICtrlSetState($idBtnNext, $GUI_DISABLE) EndSwitch EndSelect WEnd EndFunc ;==>Example Link to comment Share on other sites More sharing options...
genius257 Posted December 31, 2016 Share Posted December 31, 2016 (edited) What windows version are you using? I'm using Win10 Version 1607. And i can't seem to get _GUICtrlRichEdit_HideSelection to work. I'm suspecting it might be windows 10 related Edit: never mind, i misunderstood what HideSelction is supposed to do. Just to be clear what do you expect to happen? because as i read it, it's setting if selection is visible when loosing focus Edited December 31, 2016 by genius257 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
nobbitry Posted December 31, 2016 Author Share Posted December 31, 2016 Ok, same Windows version here (Win 10 v1607 x64). Link to comment Share on other sites More sharing options...
genius257 Posted December 31, 2016 Share Posted December 31, 2016 16 minutes ago, genius257 said: Just to be clear what do you expect to happen? because as i read it, it's setting if selection is visible when loosing focus nobbitry 1 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
nobbitry Posted December 31, 2016 Author Share Posted December 31, 2016 Ah I got it. Sorry. I thought _GUICtrlRichEdit_HideSelection($g_hRichEdit, True) would hide the selection in the active window. Thank you. Link to comment Share on other sites More sharing options...
genius257 Posted December 31, 2016 Share Posted December 31, 2016 (edited) 4 minutes ago, nobbitry said: Ah I got it. Sorry. I thought _GUICtrlRichEdit_HideSelection($g_hRichEdit, True) would hide the selection in the active window. Thank you. Hehe totally understand why you would think that. I was under the same impression, until reading TextBoxBase.HideSelection Property from MSDN. Edited December 31, 2016 by genius257 Spell check My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now