Sign in to follow this  
Followers 0
sylvanie

how to set the text color of a stus bar ?

8 posts in this topic

Hello !

I have looking for a way to color the text of a statusbar, like _GUICtrlStatusBarSetBKColor for the Background, but i haven't found.

Is it possible actualy to do it ?

Thanks


Share this post


Link to post
Share on other sites



Hello !

I have looking for a way to color the text of a statusbar, like _GUICtrlStatusBarSetBKColor for the Background, but i haven't found.

Is it possible actualy to do it ?

Thanks

I want to know too ...


Expo 2010 Shanghai China中国2010年上海世博会

Share this post


Link to post
Share on other sites

wow... straight from help

this does not work... but, even more it does not error for $CLR_MONEYGREEN (non declared)!!!...???

#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <Constants.au3>

Opt('MustDeclareVars', 1)

$Debug_SB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()

    Local $hGUI, $hStatus
    Local $aParts[3] = [75, 150, -1]
    
    ; Create GUI
    $hGUI = GUICreate("(Example 1) StatusBar Set BkColor", 400, 300)
    $hStatus = _GUICtrlStatusBar_Create ($hGUI)
    GUISetState()

    ; Set parts
    _GUICtrlStatusBar_SetParts ($hStatus, $aParts)
    _GUICtrlStatusBar_SetText ($hStatus, "Part 1")
    _GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1)

    ; Set background color
    _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_MONEYGREEN)

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

wow... straight from help

this does not work... but, even more it does not error for $CLR_MONEYGREEN (non declared)!!!...???

#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <Constants.au3>

Opt('MustDeclareVars', 1)

$Debug_SB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()

    Local $hGUI, $hStatus
    Local $aParts[3] = [75, 150, -1]
    
    ; Create GUI
    $hGUI = GUICreate("(Example 1) StatusBar Set BkColor", 400, 300)
    $hStatus = _GUICtrlStatusBar_Create ($hGUI)
    GUISetState()

    ; Set parts
    _GUICtrlStatusBar_SetParts ($hStatus, $aParts)
    _GUICtrlStatusBar_SetText ($hStatus, "Part 1")
    _GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1)

    ; Set background color
    _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_MONEYGREEN)

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

8)

Works for me. $CLR_MONEYGREEN is defined in Constants.au3


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Works for me. $CLR_MONEYGREEN is defined in Constants.au3

Maybe its Xp

This works...

#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <Constants.au3>

Opt('MustDeclareVars', 1)

Dim $XS_n

$Debug_SB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()

    Local $hGUI, $hStatus
    Local $aParts[3] = [75, 150, -1]
    
    ; Create GUI
    $hGUI = GUICreate("(Example 1) StatusBar Set BkColor", 400, 300)
    XPStyle()   
    $hStatus = _GUICtrlStatusBar_Create ($hGUI)
    XPStyle(0)
    GUISetState()

    ; Set parts
    _GUICtrlStatusBar_SetParts ($hStatus, $aParts)
    _GUICtrlStatusBar_SetText ($hStatus, "Part 1")
    _GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1)

    ; Set background color
    _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_MONEYGREEN)

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main



 Func XPStyle($OnOff = 1)   
    If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return 1
    ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    EndIf
    Return 0
EndFunc   ;==>XPStyle

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

THX for Gary & Valuater!

but we want is not _GUICtrlStatusBarSetBKColor,

just like _GUICtrlStatusBarSetTxtColor ,to change the TXT Color.


Expo 2010 Shanghai China中国2010年上海世博会

Share this post


Link to post
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
Sign in to follow this  
Followers 0