0
Windows 7中,PowerShell的5傳遞變量爲XAML
在布魯斯·帕耶特的書「的Windows PowerShell在行動」(2)754頁上有一個名爲「建設文件搜索工具」一個WPF的例子。
我需要修改的XAML的ComboBox
(原爲TextBox
)在PowerShell中的變量$pwd
和[Environment]::GetFolderPath("MyDocuments")
路過使用的東西 這樣的:
<Label Width="100" >Path to Search</Label>
<ComboBox Name="Path" Width="324" Height="23" IsEditable="True">
<ComboBoxItem >d:\files</ComboBoxItem>
</ComboBox>
$path = $form.FindName("Path")
$path.DropDown = $pwd
有沒有辦法做到這一點,請?
非常感謝;但這不是解釋,即它顯示爲文字_ $ pwd_。 – Archdeacon