Jump to content

Change the font color of only some of an inputbox.


Recommended Posts

Hey guys, A quick question before I head off to church. How would I change the text color of only parts of a inputbox on a gui? For example, I'm making a chat program. I want the messages that say somebody had joined or left the channel to be red instead of the normal black that the rest of the text is , but I want the rest of the type to still be black. This all has to be done in one inputbox so I am really unsure how to do this. If there was a way to have something like GUICtrlSetColor set the color of maybe just a certain line of the inputbox or just some of the text, I would love to know it. Thanks.

Link to comment
Share on other sites

Hey guys, A quick question before I head off to church. How would I change the text color of only parts of a inputbox on a gui? For example, I'm making a chat program. I want the messages that say somebody had joined or left the channel to be red instead of the normal black that the rest of the text is , but I want the rest of the type to still be black. This all has to be done in one inputbox so I am really unsure how to do this. If there was a way to have something like GUICtrlSetColor set the color of maybe just a certain line of the inputbox or just some of the text, I would love to know it. Thanks.

can't be done in a normal input control or edit control, you need to use something like a richedit or even embed word into the gui.

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

can't be done in a normal input control or edit control, you need to use something like a richedit or even embed word into the gui.

this can be done i was searching myself

i did this

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
$installwindow = GUICreate("ECC application installer - progress", 400, 400) 
$installlog = GUICtrlCreateEdit("ECC Installer started: [" & @ComputerName & "]" & @CRLF & "-----------------------------",10,10,380,380,$ES_AUTOVSCROLL+$WS_VSCROLL+$WS_VSCROLL+$ES_READONLY,$WS_EX_STATICEDGE)
GUICtrlSetColor(-1,0xffffff)
GUICtrlSetBkColor(-1,0x005500)
GUISetState(@SW_SHOW)
Link to comment
Share on other sites

this can be done i was searching myself

i did this

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
$installwindow = GUICreate("ECC application installer - progress", 400, 400) 
$installlog = GUICtrlCreateEdit("ECC Installer started: [" & @ComputerName & "]" & @CRLF & "-----------------------------",10,10,380,380,$ES_AUTOVSCROLL+$WS_VSCROLL+$WS_VSCROLL+$ES_READONLY,$WS_EX_STATICEDGE)
GUICtrlSetColor(-1,0xffffff)
GUICtrlSetBkColor(-1,0x005500)
GUISetState(@SW_SHOW)
the user was asking to change only "Part" of the text color not "All"

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

been trying to modify an example i found in the help file using RICHTEXT. Some luck so far but I think I'll be able to get it to work with some more tinkering. Thanks.

yw

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

hmm... i'm having one main problem with using the richtext. Is there like a prefix that will make text after it be effected. As a hypothetical example, lets say I wanted to make the text "This is a test" be red. Could I put it in <red> "This is a test" <\red> tags and make it red. I'm pretty sure just doing that wouldn't work but is there a similar system for setting colors i could use because right not i'm using

" $font_color = _ChooseColor(0,0,1)

$oRP.SelColor = $font_color"

but you have to select the text to change its color. I want a way to only set the color of some text but not have to select it and have it automatically be colored (hope that makes sense). If there is like a readme for the richtext thing i'm using, could someone please point me to it?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...