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 4 years and 4 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.
I have a multi-form app I am working on. I have a picturebox in the middle of the main form that I update from the child form.
I have 40 images I am sorting through named "Pic1.jpg" through "Pic40.jpg" (need to restart from 1 when I go over 40). I need to update the picturebox every time I hit a button on the child form named "submit". The below counter is setup in the function $buttonSubmit_Click. However, every time I hit submit it stays at the the first picture "pic1.jpg". I am assuming it is because the counter just resets every time I hit submit. How do I get around this? Would I need to declare "$counter" a global variable? I followed the global variable documentation and was unsuccessful. I would use Get-Random but it really isn't that random.
This topic is 4 years and 4 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.