用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 科技博客