Powershell and Forms (part 3) – Checkboxes

Checkboxes in Forms

My last post was about populating a second dropdown list with data that was gathered from a choice made in the first dropdown list.  I know, I jumped ahead of myself.  Today’s post is about checkboxes in forms.  The checkbox is a very common element in forms. Having a checkbox on your form always looks nice (don’t go over the top and put too many in your form).

The script below is a nice example of how to enable and disable the OK button by checking the checkbox.

The most common usage I have seen for checkboxes is on a survey, or when you agree to a license agreement during a software install. Have fun playing with the controls and feel free to comment.

8 comments

  1. Superb website you have here but I was curious if you knew of any community
    forums that cover the same topics talked about here? I’d really love to be a part of community where I can get comments from other knowledgeable individuals that share the same interest.
    If you have any recommendations, please let me know.
    Kudos!

  2. Ꮩery good website you have here but I was wanting to know if you knew of any community
    foгums that cover the same topics talked about in tһis article?
    I’d really like to be a part of online community
    where I can get feedback from other experienced people that share the same interest.
    If you have any recommendations, please lеt me know. Kudos!

  3. i try to make a backuptool with folder copy. but the script starts to copy all folders before i can choose one of my 3 checkboxes (each for other folder). Pls help me, i read many in google… but not found anything for my problem

    #######################################################
    #$checkbox1.Add_CheckStateChanged({
    #$OKButton.Enabled = $checkbox1.Checked })

    If ($checkbox1.Checked = $true) { copy-item “C:\Users\Bernd PC\Links\” “D:\111\Links\” -recurse }
    If ($checkbox2.Checked = $true) { copy-item “C:\Users\Bernd PC\Favoriten\” “D:\111\Favoriten\” -recurse }

Leave a Reply

Your email address will not be published. Required fields are marked *