列表的 Powershell-GUI 过滤器
Powershell-GUI filter for a list
我尝试使用 Powershell-GUI 构建搜索列表表单。
$searchButton = GenerateButton -text 'search' -x 10 -y 280 -action {
$data = $listForm.Items -like "*$searchInput.Text*"
$listForm.DataSource = $data
}
过滤器 -like
不适用于对象。
如果您想将某些内容与 $searchInput
的 Text
属性 的值进行比较,您必须在字符串中使用子表达式:
$data = $listForm.Items -like "*<b>$($searchInput.Text)</b>*"
我尝试使用 Powershell-GUI 构建搜索列表表单。
$searchButton = GenerateButton -text 'search' -x 10 -y 280 -action {
$data = $listForm.Items -like "*$searchInput.Text*"
$listForm.DataSource = $data
}
过滤器 -like
不适用于对象。
如果您想将某些内容与 $searchInput
的 Text
属性 的值进行比较,您必须在字符串中使用子表达式:
$data = $listForm.Items -like "*<b>$($searchInput.Text)</b>*"