Shy Posted January 28, 2010 Share Posted January 28, 2010 I have an edit control I use as a log for my various application. I want to be able to write certain lines in red text (errors) and others in blue (notification). Is this possible? When I use GUICtrlSetColor() it colors the entire text in the Edit control. If it is not possible, is there anyway to color the background of just a single line? If it is not possible, is there a "rich-text" control I can use and have this functionality? Thank you in advance Link to comment Share on other sites More sharing options...
GEOSoft Posted January 29, 2010 Share Posted January 29, 2010 Help File >> User Defined Functions >> GUIRichText Management. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Shy Posted January 29, 2010 Author Share Posted January 29, 2010 Help File >> User Defined Functions >> GUIRichText Management.Should conclude from your reply there is not way to do it in the Edit control? Link to comment Share on other sites More sharing options...
GEOSoft Posted January 29, 2010 Share Posted January 29, 2010 Should conclude from your reply there is not way to do it in the Edit control?Not in a simple edit control and that applies to any language that uses Edit controls. The coloring requires Rich-Edit. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Shy Posted January 29, 2010 Author Share Posted January 29, 2010 Not in a simple edit control and that applies to any language that uses Edit controls. The coloring requires Rich-Edit.Thanks a lot Link to comment Share on other sites More sharing options...
Shy Posted January 29, 2010 Author Share Posted January 29, 2010 When I use _GUICtrlRichEdit_SetCharColor() it colors the entire text in the control. I could insert the new text using _GUICtrlRichEdit_AppendText() and then calculate the location and select and color just these specific text. But, this method appears very bad in terms of performance and I was hoping you could point me to a better way to write the new line in a different color. Thanks Link to comment Share on other sites More sharing options...
ds34 Posted February 10, 2010 Share Posted February 10, 2010 When I use _GUICtrlRichEdit_SetCharColor() it colors the entire text in the control.I could insert the new text using _GUICtrlRichEdit_AppendText() and then calculate the location and select and color just these specific text.But, this method appears very bad in terms of performance and I was hoping you could point me to a better way to write the new line in a different color.ThanksAny solution for this? Link to comment Share on other sites More sharing options...
wraithdu Posted February 10, 2010 Share Posted February 10, 2010 Use a listview control and handle the NM_CUSTOMDRAW message: http://www.autoitscript.com/forum/index.php?showtopic=65556&st=0&p=487264&#entry487264 Or use this UDF: http://www.autoitscript.com/forum/index.php?showtopic=89654 Tapaswini 1 Link to comment Share on other sites More sharing options...
martin Posted February 10, 2010 Share Posted February 10, 2010 Any solution for this?The text colour is applied to the selected text so if you want only certain cgaracters to be coloured then you must select them first. 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...
ds34 Posted February 11, 2010 Share Posted February 11, 2010 (edited) The text colour is applied to the selected text so if you want only certain cgaracters to be coloured then you must select them first.Thanks. I saw this solution being used in some post for Single Line. I tried with multiline but failed, the selection is going wrong. Since it appears to me to be a sw-problem I created http://www.autoitscript.com/forum/index.php?showtopic=109876 Edited February 11, 2010 by ds34 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