最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Powershell使用WPF技術(shù)實(shí)現(xiàn)彈窗提示實(shí)例

 更新時(shí)間:2014年05月07日 11:29:50   作者:  
這篇文章主要介紹了Powershell使用WPF技術(shù)實(shí)現(xiàn)彈窗提示實(shí)例,需要的朋友可以參考下

WPF (Windows Presentation Foundation) 技術(shù)能讓你創(chuàng)建窗口和對(duì)話(huà)框。它的優(yōu)勢(shì)是在窗體設(shè)計(jì)時(shí)能與代碼分開(kāi)。

這里有個(gè)簡(jiǎn)單的顯示彈出消息練習(xí)。這個(gè)消息是定義在XAML代碼中它的實(shí)現(xiàn)類(lèi)似HTML(但是請(qǐng)區(qū)分大小寫(xiě))。你能輕松的調(diào)整字體大小,內(nèi)容,顏色等等。不需要嵌入任何代碼。

復(fù)制代碼 代碼如下:

$xaml = @"
<Window
 xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>

 <Border BorderThickness="20" BorderBrush="Yellow" CornerRadius="9" Background='Red'>
  <StackPanel>
   <Label FontSize="50" FontFamily='Stencil' Background='Red' Foreground='White' BorderThickness='0'>
    System will be rebooted in 15 minutes!
   </Label>

   <Label HorizontalAlignment="Center" FontSize="15" FontFamily='Consolas' Background='Red' Foreground='White' BorderThickness='0'>
    Worried about losing data? Talk to your friendly help desk representative and freely share your concerns!
   </Label>
  </StackPanel>
 </Border>
</Window>
"@

$reader = [System.XML.XMLReader]::Create([System.IO.StringReader] $xaml)
$window = [System.Windows.Markup.XAMLReader]::Load($reader)
$Window.AllowsTransparency = $True
$window.SizeToContent = 'WidthAndHeight'
$window.ResizeMode = 'NoResize'
$Window.Opacity = .7
$window.Topmost = $true
$window.WindowStartupLocation = 'CenterScreen'
$window.WindowStyle = 'None'
# show message for 5 seconds:
$null = $window.Show()
Start-Sleep -Seconds 5
$window.Close()

相關(guān)文章

最新評(píng)論

郓城县| 山东省| 松滋市| 大同县| 布尔津县| 内黄县| 静宁县| 微山县| 同德县| 河南省| 瑞金市| 安岳县| 合水县| 武乡县| 双流县| 西宁市| 泗洪县| 大庆市| 华安县| 南京市| 紫金县| 汉寿县| 南丰县| 上蔡县| 呼玛县| 二连浩特市| 阳曲县| 特克斯县| 大洼县| 东兴市| 赤水市| 平顶山市| 杨浦区| 筠连县| 开原市| 桃源县| 高碑店市| 镇远县| 固原市| 沈丘县| 错那县|