d0n Posted October 25, 2009 Share Posted October 25, 2009 is it possible to make the edit box show different color of text? Example Apple(In red) Banana(In yellow) all in one edit box? GUICtrlsetcolor only changes the color for the whole edit box Link to comment Share on other sites More sharing options...
Authenticity Posted October 25, 2009 Share Posted October 25, 2009 You're looking for a rich edit control. Search the Example forum. Link to comment Share on other sites More sharing options...
Mat Posted October 25, 2009 Share Posted October 25, 2009 There are a lot of ways, but not easy ways. Richedits will be the easiest, and there are some UDF's in example scripts on that. one way i'm looking at is creating an internet explorer object, disable it, add a label on top that when clicked focuses a hidden edit, that when changed updates the html source of the ie object. I practically gave up on this very soon after starting, as I have no need for something this complex. Overlays could also be used, but good luck with that Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
d0n Posted October 25, 2009 Author Share Posted October 25, 2009 I got it to work, but the color seems to be off Using autoit window info i get the color i want to be 0x35ADFF _GUICtrlRichEdit_SetBold($Label, True, True) _GUICtrlRichEdit_SetFontColor($Label, 0x35ADFF, True) _GUICtrlRichEdit_AppendText($Label, $Text[$a]&@CRLF) Using this code and taking the color again, comes out an orange hue with this 0xFFAD35 Link to comment Share on other sites More sharing options...
Mat Posted October 25, 2009 Share Posted October 25, 2009 Thats the difference between BGR and RGB Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 25, 2009 Moderators Share Posted October 25, 2009 d0n,i want to be 0x35ADFFcomes out...0xFFAD35My instant thought was a BGR vs. RGB clash. A search for _GUICtrlRichEdit_SetFontColor found this:Function Name: _GUICtrlRichEdit_SetFontColor; Description: Select the text color; Parameters : $hWnd - Handle to the control; $hColor - Color value (BGR)So the answer is simple - put your colour in BGR form and all will be well - or rewrite the function to use RGB! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mat Posted October 25, 2009 Share Posted October 25, 2009 Func _BgrtoRgb ($In, $bPrefix = True) Local $ret = "0x" If Not $bPrefix Then $ret = "" $In = Hex (Execute ($In), 6) ; << makes sure you can enter whatever and itll work Return $ret & StringRight ($iColorRef, 2) & StringMid ($iColorRef, 3, 2) & StringLeft ($iColorRef, 2) EndFunc ; ==> _BgrtoRgb AutoIt Project Listing Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 25, 2009 Moderators Share Posted October 25, 2009 Mat, Feeling generous today? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted October 25, 2009 Share Posted October 25, 2009 Yeah, right.Mat's fixed:ConsoleWrite(_BgrtoRgb(BinaryToString("0x4265657028313034372C353632294265657028313332392C333735294265657028313438302C333735294265657028313736302C313838294265657028313536382C353632294265657028313332392C333735294265657028313034372C33373529")) & @CRLF) Func _BgrtoRgb ($In, $bPrefix = True) Local $ret = "0x" If Not $bPrefix Then $ret = "" $In = Hex (Execute ($In), 6) ; << makes sure you can enter whatever and itll work Return $ret & StringRight ($In, 2) & StringMid ($In, 3, 2) & StringLeft ($In, 2) EndFunc ; ==> _BgrtoRgbIs that ok? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
d0n Posted October 25, 2009 Author Share Posted October 25, 2009 thanks, just changed it to BGR in the autoit info window to get it Link to comment Share on other sites More sharing options...
Mat Posted October 25, 2009 Share Posted October 25, 2009 Yeah, right.Can't be too helpful can i , it was just copied code that wasn't copied perfectly...Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
trancexx Posted October 26, 2009 Share Posted October 26, 2009 Can't be too helpful can i , it was just copied code that wasn't copied perfectly...MatI commented part of that function that was yours, not copied. ♡♡♡ . eMyvnE 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