New Member Posted June 26, 2006 Share Posted June 26, 2006 Hi everybody, I'm just wondering if it's possible to have different colours for the text in an edit control. i.e. whether a kind of "syntax highlighting" is possible in an edit control. Link to comment Share on other sites More sharing options...
syberschmo Posted June 26, 2006 Share Posted June 26, 2006 Hi everybody, I'm just wondering if it's possible to have different colours for the text in an edit control. i.e. whether a kind of "syntax highlighting" is possible in an edit control.I'm interested in this myself. GUI gurus, a little help?Regards, Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
GaryFrost Posted June 26, 2006 Share Posted June 26, 2006 Richedit not edit controls There is an example in the beta help file I believe. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
syberschmo Posted June 26, 2006 Share Posted June 26, 2006 Richedit not edit controls There is an example in the beta help file I believe.Gary I found the example: expandcollapse popup; Rich edit control EXAMPLE using GUICtrlCreateObj ; Author: Kåre Johansson ; AutoIt Version: 3.1.1.55 ; Description: Very Simple example: Embedding RICHTEXT object ; Needs: MSCOMCT2.OCX in system32 but it's probably already there ; Date: 3 jul 2005 #include <GUIConstants.au3> $oRP = ObjCreate("RICHTEXT.RichtextCtrl.1") GUICreate("Embedded RICHTEXT control Test", 320, 200, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 180, 100, 15, $SS_CENTER) GuiCtrlSetFont($TagsPageC,9,400,4) GuiCtrlSetColor($TagsPageC,0x0000ff) GuiCtrlSetCursor($TagsPageC,0) $AboutC = GUICtrlCreateButton('About',105,177,70,20) $PrefsC = GUICtrlCreateButton('FontSize',175,177,70,20) $StatC = GUICtrlCreateButton('Plain Style',245,177,70,20) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 400 , 260 ) GUICtrlSetPos($GUIActiveX,10,10,300,160) With $oRP; Object tag pool .OLEDrag() .Font = 'Arial' .text = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload' ;.FileName = @ScriptDir & '\RichText.rtf' ;.BackColor = 0xff00 EndWith GUISetState ();Show GUI While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $oRP.SaveFile( @ScriptDir & "\RichText.rtf", 0 ) ExitLoop Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={3B7C8860-D78F-101B-B9B5-04021C009402}','', @SW_HIDE) Case $msg = $AboutC $oRP.AboutBox() Case $msg = $PrefsC $oRP.SelFontSize = 12 Case $msg = $StatC $oRP.SelBold = False $oRP.SelItalic = False $oRP.SelUnderline = False $oRP.SelFontSize = 8 EndSelect WEnd However, I am no COM master. I tried the .SelText method but it just inserts the string at the beginning of the edit control. Could you point me in the direction of a highlight method? Thanks in advance and regards Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
New Member Posted June 27, 2006 Author Share Posted June 27, 2006 Gary I found the example: [autoit]; Rich edit control EXAMPLE using GUICtrlCreateObj ; Author: Kåre Johansson ; AutoIt Version: 3.1.1.55 ; Description: Very Simple example: Embedding RICHTEXT object ; Needs: MSCOMCT2.OCX in system32 but it's probably already there ; Date: 3 jul 2005 Didn't appear to be what I need. I mean a way to make the text enterd in an edit control show in different pre-determined colours as in programmers editors like Crimson Editor, Scite etc. Thanks all the same! Link to comment Share on other sites More sharing options...
syberschmo Posted June 27, 2006 Share Posted June 27, 2006 Didn't appear to be what I need. I mean a way to make the text enterd in an edit control show in different pre-determined colours as in programmers editors like Crimson Editor, Scite etc. Thanks all the same!I think Gary meant that a Rich Edit control will allow the functionality that you desire. The example that I posted needs to be extended. Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
everseeker Posted June 15, 2009 Share Posted June 15, 2009 I think Gary meant that a Rich Edit control will allow the functionality that you desire. The example that I posted needs to be extended.I am looking for a Way to get this in a text box.... Everseeker Link to comment Share on other sites More sharing options...
BrettF Posted June 15, 2009 Share Posted June 15, 2009 That is exactly what Gary has said. It is a RICHEDIT not an EDIT control that will give you that functionality. Search for it, because there are a few different examples around the place. I didn't think it was that hard to understand Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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