AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text Control Colors

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
damajha



Joined: 23 Oct 2006
Posts: 31

PostPosted: Mon Jan 14, 2008 9:49 pm    Post subject: Text Control Colors Reply with quote

I asked something along these lines before, but I don't think I explained my self properly.

I have a text control that loops through 3 different colors and prints them. I was wondering if it is possible to change the text color to match the text? (When Blue is Output to the Gui to have it print in Blue etc)

Code:

Gui, Font, S14 CDefault, Verdana
Gui, Add, Text, x16 y10 w100 h30 vCols, Red
Gui, Show, Colors

Colors = Red Blue Green
StringSplit, List, Colors, %A_Space%
Loop, %List0%
{
  GuiControl,, Cols, % List%A_Index%
  Sleep, 2000
}
ExitApp
Back to top
View user's profile Send private message
damajha



Joined: 23 Oct 2006
Posts: 31

PostPosted: Mon Jan 14, 2008 10:20 pm    Post subject: Reply with quote

I came up with this. It works so I thought I would post it.

Code:

Colors = Red Blue Green
StringSplit, List, Colors, %A_Space%
Loop, %List0%
{
  TxtCol = % List%A_Index%
  SetGui()
  GuiControl,, Cols, % List%A_Index%
  Sleep, 2000
  Gui, Destroy
}
ExitApp

SetGui()
{
Global
Gui, Font, S14 CDefault, Verdana
Gui, Add, Text, x16 y10 w100 h30 c%TxtCol% vCols
Gui, Show, Colors
}


Kinda Clumsy, But...
Back to top
View user's profile Send private message
Sakurako



Joined: 10 May 2007
Posts: 142

PostPosted: Mon Jan 14, 2008 11:38 pm    Post subject: Reply with quote

Code:
Gui, Font, S14 CRed, Verdana
Gui, Add, Text, x16 y10 w100 h30 vCols, Red
Gui, Show, Colors

Colors = Red Blue Green
StringSplit, List, Colors, %A_Space%
Loop, %List0%
{
 Color := List%A_Index%
 Gui, Font, c%Color%
 GuiControl, Font, Cols
 GuiControl,, Cols, % List%A_Index%
 Sleep, 2000
}
ExitApp
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group