用WPF开发仿QQ概念版之--------MessageWindow开发以及Demo下载
转眼半年了,期间发生了很多事情,一直无暇整理该代码。不说废话了,抽时间整理了下,今天先把DEMO发出来。
一下是MessageBox窗体的代码:
MessageWindow.xaml
1 <Window
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 mc:Ignorable="d"
7 x:Class="WpfQQDemo.MessageWindow"
8 x:Name="UserControl"
9
10 d:DesignWidth="340" d:DesignHeight="142"
11 WindowStyle="None"
12 Background="{x:Null}" AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" WindowStartupLocation="CenterScreen" Icon="/WpfQQDemo;component/Images/logo32.ico" Height="142" Width="340">
13
14 <Grid x:Name="LayoutRoot">
15 <Image Margin="0" Source="/WpfQQDemo;component/Images/messagebg.png" Stretch="Fill"/>
16 <Label x:Name="LabTitle" Content="" Height="25.368" Margin="6,4,82,0" VerticalAlignment="Top" Foreground="#FFFAF9F9" FontWeight="Bold"/>
17 <Label x:Name="LabTips" Content="" Margin="56,47,13,43"/>
18 <Button x:Name="vbutton1" Content="确定" Height="28" Margin="0,0,29,5" VerticalAlignment="Bottom" Click="vbutton1_Click" HorizontalAlignment="Right" Width="78" />
19 <Button x:Name="vbutton2" Content="取消" Height="28" Margin="69,0,0,5" VerticalAlignment="Bottom" Click="vbutton2_Click" HorizontalAlignment="Left" Width="78" />
20 <Button x:Name="vbutton3" Content="忽略" Height="28" Margin="151,0,111,5" VerticalAlignment="Bottom" Click="vbutton3_Click" />
21 <Label x:Name="vPicBox" Content="" HorizontalAlignment="Left" Margin="8,47,0,52" Width="44"/>
22 <Button x:Name="buttonclose" Content="X" Template="{StaticResource temp_b_top_close}" HorizontalAlignment="Right" Margin="0,6.368,10.16,0" Width="22" RenderTransformOrigin="0.5,0.5" Click="buttonclose_Click" Height="22" VerticalAlignment="Top">
23 <Button.RenderTransform>
24 <TransformGroup>
25 <ScaleTransform/>
26 <SkewTransform/>
27 <RotateTransform/>
28 <TranslateTransform/>
29 </TransformGroup>
30 </Button.RenderTransform>
31 </Button>
32 </Grid>
33 </Window>
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 mc:Ignorable="d"
7 x:Class="WpfQQDemo.MessageWindow"
8 x:Name="UserControl"
9
10 d:DesignWidth="340" d:DesignHeight="142"
11 WindowStyle="None"
12 Background="{x:Null}" AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" WindowStartupLocation="CenterScreen" Icon="/WpfQQDemo;component/Images/logo32.ico" Height="142" Width="340">
13
14 <Grid x:Name="LayoutRoot">
15 <Image Margin="0" Source="/WpfQQDemo;component/Images/messagebg.png" Stretch="Fill"/>
16 <Label x:Name="LabTitle" Content="" Height="25.368" Margin="6,4,82,0" VerticalAlignment="Top" Foreground="#FFFAF9F9" FontWeight="Bold"/>
17 <Label x:Name="LabTips" Content="" Margin="56,47,13,43"/>
18 <Button x:Name="vbutton1" Content="确定" Height="28" Margin="0,0,29,5" VerticalAlignment="Bottom" Click="vbutton1_Click" HorizontalAlignment="Right" Width="78" />
19 <Button x:Name="vbutton2" Content="取消" Height="28" Margin="69,0,0,5" VerticalAlignment="Bottom" Click="vbutton2_Click" HorizontalAlignment="Left" Width="78" />
20 <Button x:Name="vbutton3" Content="忽略" Height="28" Margin="151,0,111,5" VerticalAlignment="Bottom" Click="vbutton3_Click" />
21 <Label x:Name="vPicBox" Content="" HorizontalAlignment="Left" Margin="8,47,0,52" Width="44"/>
22 <Button x:Name="buttonclose" Content="X" Template="{StaticResource temp_b_top_close}" HorizontalAlignment="Right" Margin="0,6.368,10.16,0" Width="22" RenderTransformOrigin="0.5,0.5" Click="buttonclose_Click" Height="22" VerticalAlignment="Top">
23 <Button.RenderTransform>
24 <TransformGroup>
25 <ScaleTransform/>
26 <SkewTransform/>
27 <RotateTransform/>
28 <TranslateTransform/>
29 </TransformGroup>
30 </Button.RenderTransform>
31 </Button>
32 </Grid>
33 </Window>
当然还有一个MessageBoxEx类,您自己在DEMO中反编译看看吧,我就不写出来了。
Demo下载地址:Demo
新站上线--咱地里 www.zandili.com 科技博客
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述