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.
This topic is 5 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
raphaelgj
Posts: 23
Last visit: Thu Aug 17, 2023 8:41 am

StatusBar change text color

Post by raphaelgj »

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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: StatusBar change text color

Post by jvierra »

A statusbar does not have a settable color. To get settable color use a StatusStrip control.
User avatar
raphaelgj
Posts: 23
Last visit: Thu Aug 17, 2023 8:41 am

Re: StatusBar change text color

Post by raphaelgj »

Good to know very helpful
This topic is 5 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked