Haseeb Posted May 28, 2008 Share Posted May 28, 2008 (edited) hi, my problem is... If WinExists(\\\"Bucket\\\") Then WinClose(\\\"Bucket\\\") MsgBox(0, \\\"Thius website is not allowed\\\", \\\"Restrictions Found\\\") EndIf this will detect and close a window with a message. now i want to change the colour of text in message. i am totally a newbie so dont know what to do and where to start. i want to change the text colour of message box to Red. and also want to know how to change to other colours. anyone please help me. Edited May 28, 2008 by GsmExpert Link to comment Share on other sites More sharing options...
weaponx Posted May 28, 2008 Share Posted May 28, 2008 You can't change colors with the builtin MsgBox() you have to use a customizable MsgBox() UDF:http://www.autoitscript.com/forum/index.ph...=custom++msgbox Link to comment Share on other sites More sharing options...
Haseeb Posted May 28, 2008 Author Share Posted May 28, 2008 i could not understand how to use it. can you give me a example or can change my code into yours with update ? thanx. Link to comment Share on other sites More sharing options...
Haseeb Posted May 28, 2008 Author Share Posted May 28, 2008 i could not understand how to use it. can you give me a example or can change my code into yours with update ? thanx. Link to comment Share on other sites More sharing options...
Haseeb Posted May 28, 2008 Author Share Posted May 28, 2008 (edited) ok problem solvedFunc ColorTextBox($title,$text,$color) Local $L_TEXT = StringLen($text) Local $ROW = Int(Number($L_TEXT) / 45) + 1 Local $GUI = GUICreate($title,300,15*Number($ROW) + 30,-1,-1) Local $FIELD = GUICtrlCreateLabel($text,5,5,290,15*Number($ROW),0x01) Local $OK = GUICtrlCreateButton("OK",130,15*Number($ROW) + 5,40,20) GUICtrlSetColor ($FIELD,$color) GUISetState(@SW_SHOW,$GUI) While 1 Local $MSG = GUIGetMsg() If $MSG = $OK Then GUIDelete($GUI) ExitLoop EndIf WEnd EndFunc $MESSAGE = "AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys)." If WinExists("MyWindowTitle") Then WinClose("MyWindowTitle") ColorTextBox("Test colors",$MESSAGE,0xFF0000) EndIfThanks to Ahsan and Andreik for help! Edited May 28, 2008 by GsmExpert 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