Check of Checkboxes

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 7 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
boskap
Posts: 21
Last visit: Sun Oct 21, 2018 4:24 am

Check of Checkboxes

Post by boskap »

Sorry for that title

i hafe a gui like an software installer where you can check checkboxes
press a start button
the tasks will run

but i want to popup a messagebox when all tasks are done
whats the best way

i think about to check of any checkbox is checked and when yes start messagebox
but how ?

thx Peter
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Check of Checkboxes

Post by jvierra »

[System.Windows.Forms.MessageBox]::Show('your message')

See: https://info.sapien.com/index.php/guis/ ... dlYm94Il0=
boskap
Posts: 21
Last visit: Sun Oct 21, 2018 4:24 am

Re: Check of Checkboxes

Post by boskap »

how i make a messagebox i know

but i only want to show it after the tasks of software installation
so i must check if any checkbox is checked and when yes show the message box

how i check them all
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Check of Checkboxes

Post by jvierra »

Code: Select all

if($checkbox1.Checked){
      # box checked
}else{
     # bos not checked
}
See: https://info.sapien.com/index.php/guis/ ... ox-control

For most GUI items and usage check here: https://info.sapien.com/index.php/guis/gui-controls
boskap
Posts: 21
Last visit: Sun Oct 21, 2018 4:24 am

Re: Check of Checkboxes

Post by boskap »

thx
but thats also clear
so i install my software after press the startbutton

is it possible to check all at the same time with a variable

i dont want querry checkbox1, checkbox2 and......
i like if checkbox*.checked or so in this form then

thx
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Check of Checkboxes

Post by jvierra »

That is not how Forms and PowerShell work.

Read the articles here: https://info.sapien.com/index.php/guis

Here is a good tutorial to get you started with PowerShell: https://mva.microsoft.com/en-us/trainin ... shell-8276
This topic is 5 years and 7 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