Mikeman27294 Posted July 3, 2011 Share Posted July 3, 2011 (edited) Hello everyone.I have been working with a rich editbox. I have indents working well, the only problem being that once I have indented, it selects the text. I know that if I set it not to sleep, then it wil not select the text, the problem then being that it just continues to insert indents. Here is the code for the indent function.Func _Indent() _GUICtrlRichEdit_InsertText($Richedit, " ") Sleep(500) Do _GUICtrlRichEdit_InsertText($Richedit, " ") Sleep(100) Until Not _IsPressed(09) EndFuncI am calling this function using This code in a while loop in my main function.Case _IsPressed("09") _Indent()This is the code that I am using for my GUI and rich editbox.GUICreate("", @DesktopWidth*0.75, @DesktopHeight*0.75, @DesktopWidth*0.125, @DesktopHeight*0.125, 0x010F0000)And$CodeDialog = _GUICtrlRichEdit_Create($hGUI, "", 2, 2, $DialogWidth, $DialogHeight, 0x0044)Anybody know anything that can be done to prevent it from selecting the text inside the rich editbox?Thanks.EDITI just found the command _GUICtrlRichEdit_Deselect and I implemented that into my script more times than should be nessecary... but that hasnt worked._GUICtrlRichEdit_InsertText($CodeDialog, " ") Sleep(10) _GUICtrlRichEdit_Deselect($CodeDialog) Sleep(500) _GUICtrlRichEdit_Deselect($CodeDialog)See? more times than nessecary... but that hasnt helped at all. Edited July 3, 2011 by Mikeman27294 Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 3, 2011 Author Share Posted July 3, 2011 Anybody got any ideas? Link to comment Share on other sites More sharing options...
martin Posted July 3, 2011 Share Posted July 3, 2011 (edited) Anybody got any ideas? You are a bit impatient, especially since it's Sunday (for me anyway) Why do you want to insert a variable number of tabs? It would be easier to insert only one for each key press. So Func _Indent() _GUICtrlRichEdit_InsertText($Richedit, " ") Do Sleep(50) Until Not _IsPressed(09) EndFunc As far as the highlighting problem goes I would need as small working example to show the issue, but if you don't want any of the text selected could you just have SetSel with the end the same as the start? Edited July 3, 2011 by martin 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. Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 4, 2011 Author Share Posted July 4, 2011 Thanks. Yeah, I was a little impatient. It is basically going to be part of a larger application, but this part being similar to notepad. But thanks for that idea... I will take a look after I have done my assessment due tomorrow (I shouldnt have left it so late lol). Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 6, 2011 Author Share Posted July 6, 2011 No ideas?; Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 15, 2011 Author Share Posted July 15, 2011 Guess not. Anybody know how to edit the title? I'm sure I have seen it done before. 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