English 中文(简体)
清除右翼演播室中一个检查箱中的检查箱
原标题:Clearing checkboxes in a checkedboxlist in powershell studio

我有一个庞大的核对箱子清单,我制造了我需要一个 but子来清除所有检查物品。 在这方面,我已经:

 $btnResetGroups_Click = {
    foreach ($chkbox in $chklistGroups)
    {
        $chkbox.ClearSelected() # I tried to do $chkbox.Checked = $false but it doesn t recognize  checked  as a property
    }

    #   $chklistGroups.ClearSelected()
}

为什么不工作?

http://www.un.org。 该守则载有检查箱清单:

$formPTINewUserCreation_Load={
    Import-Module ActiveDirectory

    # read in the XML files
    [xml]$NewUserXML = Get-Content -LiteralPath \papertransport.comfilesUserDocumentsmneisCodeXMLNewUserTest.xml

    # popoulate the checklist with the groups from active directory
    $AD_ResourceGroups = Get-ADGroup -filter * -SearchBase "OU=Resource Groups,OU=Groups,OU=Paper Transport,DC=papertransport,DC=com"
    $AD_ResourceGroups | ForEach-Object { $chklistGroups.Items.Add($_.name) }
}

This

最佳回答

为确保在纽特被点击时每个检查箱都不受检查,该代码必须通过集装箱存放检查箱。

$btnResetGroups_Click = {
    # get the container (in this case it looks like a list box)
    $myCheckBoxes = $myListBox.Items
    # next loop through each checkbox in the array of checkbox objects
    foreach ($chkbox in $myCheckBoxes)
    {
        $chkbox.Checked = $false
    }
}

这将确保集装箱内的每个检查箱都伪造。 从“全球倡议一”的风格来看,“世界森林”而不是“温带”。

问题回答

这对我来说是有效的。

DataCheck Box.Add_click({)

    $BoxState = $DataCheckbox.CheckState
    
    if($BoxState -eq $false)
    {
      $DataCheckbox.Checked = $false
    }
    else
    {
      $DataCheckbox.Checked = $true
    }

iii





相关问题
Mutually exclusive powershell parameters

SCENARIO I m writing a cmdlet for Powershell 2.0 using Visual Studio 2008 and .NET 3.5 the cmdlet requires 3 arguments. my intended grammar of the cmdlet is something like this: cmdletname [foo|...

Run a program from PowerShell with timeout

I ll write a script that runs a program and wait for it finished. But if the program is not finished within a specified time I want that the program is killed.

How to transpose data in powershell

I have a file that looks like this: a,1 b,2 c,3 a,4 b,5 c,6 (...repeat 1,000s of lines) How can I transpose it into this? a,b,c 1,2,3 4,5,6 Thanks

Powershell v2 remoting and delegation

I have installed Powershell V2 on 2 machines and run Enable-PsRemoting on both of them. Both machines are Win 2003 R2 and are joined to the same active directory domain and I can successfully run ...

PowerShell -match operator and multiple groups

I have the following log entry that I am processing in PowerShell I m trying to extract all the activity names and durations using the -match operator but I am only getting one match group back. I m ...

热门标签