WPF 半透明窗体
来源:互联网 发布:面板数据加入虚拟变量 编辑:程序博客网 时间:2024/06/05 11:54
<Window x:Class="cn.lds.chatcore.pcw.Views.Page.Search"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:cn.lds.chatcore.pcw.Views.Page"
mc:Ignorable="d"
Title="Search" Height="300" Width="300"
AllowsTransparency="True" WindowStyle="None"
Background="Transparent">
<Grid Width="{Binding Width, ElementName=w}" Height="{Binding Height, ElementName=w}">
<Border CornerRadius="0" Margin="2,2,2,2" BorderThickness="1" BorderBrush="White"Opacity="0.5">
<!--<Border.Effect>
<DropShadowEffect ShadowDepth="0" Color="#FF414141" BlurRadius="2"/>
</Border.Effect>-->
<Border Background="Black" Opacity="0.5" Margin="0" CornerRadius="0"/>
</Border>
<Grid>
<ContentPresenter/>
</Grid>
</Grid>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:cn.lds.chatcore.pcw.Views.Page"
mc:Ignorable="d"
Title="Search" Height="300" Width="300"
AllowsTransparency="True" WindowStyle="None"
Background="Transparent">
<Grid Width="{Binding Width, ElementName=w}" Height="{Binding Height, ElementName=w}">
<Border CornerRadius="0" Margin="2,2,2,2" BorderThickness="1" BorderBrush="White"Opacity="0.5">
<!--<Border.Effect>
<DropShadowEffect ShadowDepth="0" Color="#FF414141" BlurRadius="2"/>
</Border.Effect>-->
<Border Background="Black" Opacity="0.5" Margin="0" CornerRadius="0"/>
</Border>
<Grid>
<ContentPresenter/>
</Grid>
</Grid>
</Window>
备注:Border用来实现透明效果,Grid用来显示控件,为了避免窗体内的控件变成透明的,所以Border,Grid必须处在同一级别上。
CornerRadius:设置圆角的,根据需要自行设定
DropShadowEffect : 设置阴影的,根据需要自行设定
以上部分缺一不可。
0 0
- WPF 半透明窗体
- (WPF) 半透明窗体
- WPF 半透明窗体
- 半透明窗体
- 半透明窗体
- 半透明窗体的制作
- 制作半透明窗体
- 半透明的窗体
- 透明,半透明窗体
- 半透明溅显窗体
- QT绘制半透明窗体
- 窗体重绘,半透明
- 14半透明窗体
- VC半透明窗体
- C# winform 半透明窗体
- delphi 半透明窗体类
- C# 半透明渐显窗体
- WPF窗体
- 3.Flume简单应用-netcat
- stm32 最小系统设计
- Android Notifacation设置图标无效
- 欢迎使用CSDN-markdown编辑器
- shiro与spring集成
- WPF 半透明窗体
- iOS中runtime(运行时)的简单介绍与应用
- FPGA时序优化八大忠告
- Android性能优化之使用线程池处理异步任务
- 程序员常用十大算法
- windows系统安装、启动memcached
- eclipse下使用svn,出现svn is already locked
- AndroidStudio中方法注释模板快捷键的设置
- HTML img标签之onAbort、onError、onLoad事件与问题