winform-wpf-窗体叠加显示
无论是winform内嵌wpf,还是wpf内嵌winform,效果总是不友好。那么两个窗体嵌套。这种方式简单粗暴,用户快速开发的小项目还是可以的。其实原来还是非常简单的。就是窗体叠在一起,没啥技术含量,只适合不需要自定义窗体的小项目。要特殊定制窗体样式。那么这种方式,就不适合了。
wpf-页面代码
<Window
x:Class="WF.Demo.MainWindow"
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:local="clr-namespace:WF.Demo"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="600"
AllowsTransparency="True"
Background="{x:Null}"
ShowInTaskbar="False"
WindowStyle="None"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid
Grid.Row="0"
Height="60"
Background="#CC8A2BE2">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"