Animated Gif in powershell form

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 2 months and 4 weeks 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
yves22
Posts: 24
Last visit: Tue Jul 30, 2024 11:52 pm
Been upvoted: 1 time

Animated Gif in powershell form

Post by yves22 »

Hi,

I try to put an animated Gif in a powershell form.
All is ok if nothing run. But when the application is processing the gif is freezing.
example :
  1. $Button_Connexion_Click = {
  2.     $PictureBox_SpinnerUpdate.Visible = $true
  3.          connect-viserver -server [servername] -credentials (get-credentials)
  4.          connect-mysqldatabase -server [servername] -databasename [bd_name] -credentials (get-credentials)
  5.     $PictureBox_SpinnerUpdate.Visible = $false
  6. }        
powershell version : 5.1
Powershell studio version : powershell studio 2024 version 5.8.245
OS : windows server 2022 / windows 11

Thanks for your answer,
Best regards.
User avatar
apowershelluser
Posts: 207
Last visit: Thu Oct 10, 2024 1:55 pm
Answers: 2

Re: Animated Gif in powershell form

Post by apowershelluser »

Correct , powershell is single threaded .. follow this or look at runspaces
https://www.sapien.com/blog/2012/05/16/ ... ive-forms/
This topic is 2 months and 4 weeks 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