Jump to content

Recommended Posts

Posted (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 by GsmExpert
Posted

i could not understand how to use it.

can you give me a example or can change my code into yours with update ?

thanx.

Posted

i could not understand how to use it.

can you give me a example or can change my code into yours with update ?

thanx.

Posted (edited)

ok problem solved

Func 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)
EndIf

Thanks to Ahsan and Andreik for help!

Edited by GsmExpert

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
  • Recently Browsing   0 members

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