阅读背景:

Powershell:如何更改列表框项目颜色以及在选择时更改它们

来源:互联网 

Here's what I have so far:

这是我到目前为止所拥有的:

foreach($group in $userBGroups.Items) {
    if($_.State -eq 'Selected') {
        try {
            $brush = New-Object System.Drawing.SolidBrush([System.Drawing.Color]::LightBlue)
            $_.Graphics.FillRectangle($brush, $_.bounds)
        } finally {
            $brush.Dispose()
        }
    } elseif($group -eq $lbItem) {
        try {
            $brush = New-Object System.Drawing.SolidBrush([System.Drawing.Color]::LightGreen)
            $_.Graphics.FillRectangle($brush, $_.Bounds)
        } finally {
            $brush.Dispose()
        }
    }
}
fo



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: