StatusBar change text color

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
raphaelgj
Posts: 19
Joined: Tue Jun 19, 2018 10:19 am

StatusBar change text color

Post by raphaelgj » Tue Sep 18, 2018 5:35 am

Not sure why this isn't working however i'm quite a beginner at Powershell Studio (good knowledge of powershell though!)

I have this code in a loop which works (the TEXT gets written in the status bar correctly but I want it to be yellow when it does each iteration, I added the ForeColor property but the text stays black, what am I missing? :

Code: Select all

foreach ($poste in $liste_postes)
	{
		Start-Sleep -m 200
		$statusbar.ForeColor = 'Yellow'
		$statusbar.Text = "Collecte des données du $poste en cours..."
        
	}


Thanks a lot for your time.

User avatar
jvierra
Posts: 13686
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: StatusBar change text color

Post by jvierra » Tue Sep 18, 2018 6:05 am

A statusbar does not have a settable color. To get settable color use a StatusStrip control.

User avatar
raphaelgj
Posts: 19
Joined: Tue Jun 19, 2018 10:19 am

Re: StatusBar change text color

Post by raphaelgj » Tue Sep 18, 2018 6:24 am

Good to know very helpful

Locked