Jump to content

Customising a message box ... changing text clour ( Possible ? )


Recommended Posts

hi to all

is there anyway to change clour in message box ? ( Default is Black/Gray )

for example :

MsgBox ( flag, "title", "text" [, timeout] )

this will show the message with default colour but i want to change it into red , green . etc.

if it is possible then let me know ...

i dont want to use GUI for this so help me ...

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

hi to all

is there anyway to change clour in message box ? ( Default is Black/Gray )

for example :

MsgBox ( flag, "title", "text" [, timeout] )

this will show the message with default colour but i want to change it into red , green . etc.

if it is possible then let me know ...

i dont want to use GUI for this so help me ...

It is not possible, please read the help file and learn to use GUI
Link to comment
Share on other sites

@Generator

Thanx !

--------------------

any other comments are welcomed ....

please continue this discussion.

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

can anyone provide its code with some useful information ?

because i am new to autoit ..

please.......

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

can anyone provide its code with some useful information ?

because i am new to autoit ..

please.......

Please..............................Take a look at help file and use the example code to start. Being new doesn't grant you the excuse for not learning, you won't get anywhere with your project with your attitude like this.
Link to comment
Share on other sites

sir , i have read the help file but i could not understand it.

thatswhy i was asking for the code.

please continue.....

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

Took me twenty minutes to create this:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.11.7 (beta)
 Author:         Ludocus

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>
cMsgbox(0, 'Ok', 'Ok Button' )
cMsgbox(1, 'Ok', 'OK and Cancel' )
cMsgbox(2, 'Ok', 'Abort, Retry, and Ignore' )
cMsgbox(3, 'Ok', 'Yes, No, Cancel' )
cMsgbox(4, 'Ok', 'Yes and No' )
cMsgbox(5, 'Ok', 'Retry and Cancel' )
cMsgbox(6, 'Ok', 'Cancel, Try Again, Continue' )
func cMsgbox($sValue, $sTitle, $sText, $sColor=0x000000, $sSize=8, $sType='MS Sans Serif')
global $Ok=0, $Cancel=0, $Abort=0, $Retry=0, $Yes=0, $No=0, $TryAgain=0, $Continue=0, $Ingore=0
$Form1 = GUICreate($sTitle, 278, 90, 192, 122)
$Label1 = GUICtrlCreateLabel($sText, 0, 0, 276, 49)
GUICtrlSetFont(-1, $sSize, 400, 0, $sType)
GUICtrlSetColor(-1, $sColor)
if $sValue = 0 then
$Ok = GUICtrlCreateButton("Ok", 104, 56, 75, 25, 0)
EndIf
if $sValue = 1 then
    $Ok = GUICtrlCreateButton("Ok", 104, 56, 75, 25, 0)
    $Cancel = GUICtrlCreateButton("Cancel", 184, 56, 75, 25, 0)
EndIf
if $sValue = 2 Then
    $Abort = GUICtrlCreateButton("Abort", 24, 56, 75, 25, 0)
    $Retry = GUICtrlCreateButton("Retry", 104, 56, 75, 25, 0)
    $Ingore = GUICtrlCreateButton("Ingore", 184, 56, 75, 25, 0)
EndIf
if $sValue = 3 Then
    $Ok = GUICtrlCreateButton("Yes", 24, 56, 75, 25, 0)
    $No = GUICtrlCreateButton("No", 104, 56, 75, 25, 0)
    $Cancel = GUICtrlCreateButton("Cancel", 184, 56, 75, 25, 0)
EndIf
if $sValue = 4 Then
    $Yes = GUICtrlCreateButton("Yes", 104, 56, 75, 25, 0)
    $No = GUICtrlCreateButton("No", 184, 56, 75, 25, 0)
EndIf
if $sValue = 5 Then
    $Retry = GUICtrlCreateButton("Retry", 104, 56, 75, 25, 0)
    $Cancel = GUICtrlCreateButton("Cancel", 184, 56, 75, 25, 0)
EndIf
if $sValue = 6 Then
    $Cancel = GUICtrlCreateButton("Cancel", 24, 56, 75, 25, 0)
    $TryAgain = GUICtrlCreateButton("Try again", 104, 56, 75, 25, 0)
    $Continue = GUICtrlCreateButton("Continue", 184, 56, 75, 25, 0)
EndIf
if $sValue > 6 or $sValue < 0 Then
    $Ok = GUICtrlCreateButton("Ok", 104, 56, 75, 25, 0)
EndIf

GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    if @error then return -1
        if $nMsg = $GUI_EVENT_CLOSE then
            GUIDelete($Form1)
            return 12
        EndIf
        
            
        if $nMsg = $Ok and not $Ok = 0 then
            GUIDelete($Form1)
            return 1
        EndIf
        
            
        If $nMsg = $Cancel and Not $Cancel = 0 then
            GUIDelete($Form1)
            return 2
        EndIf
        
            
        If $nMsg = $Abort and not $Abort = 0 then
            GUIDelete($Form1)
            return 3
        EndIf
        
            
        If $nMsg = $Retry and not $Retry = 0 then
            GUIDelete($Form1)
            return 4
        EndIf
        
            
        If $nMsg = $Ingore and not $Ingore = 0 then
            GUIDelete($Form1)
            return 5
        EndIf
        
            
        If $nMsg = $Yes and not $Yes = 0 then
            GUIDelete($Form1)
            return 6
        EndIf
        
            
        If $nMsg = $No and not $No = 0 then
            GUIDelete($Form1)
            return 7
        EndIf
        
            
        If $nMsg = $TryAgain and not $TryAgain = 0 then
            GUIDelete($Form1)
            return 10
        EndIf
        
            
        If $nMsg = $Continue and not $Continue = 0 then
            GUIDelete($Form1)
            return 11
        EndIf

WEnd
EndFunc

Enjoy!

Edited by ludocus
Link to comment
Share on other sites

thanks !

Your effort is not ignored.

thanks again for help and support.

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
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...