WP、Win10開發或者WPF開發時繪製自訂表單~例如:一個手機

來源:互聯網
上載者:User

標籤:

WP and Win10

效果:(數字是參考值,和UI無關)

<Page    x:Class="_05.AllControls._BorderUsePage"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:local="using:_05.AllControls"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    mc:Ignorable="d"    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">    <!--快樂玩耍:DIV一個手機-->    <Grid>        <!--手機整體-->        <Border BorderBrush="Green"                 BorderThickness="4"                CornerRadius="10,10,10,10">            <Grid>                <!--主畫面-->                <Border BorderBrush="Gray"                 BorderThickness="2"                Margin="10,60,10,30">                    <TextBlock FontFamily="微軟雅黑">對不起,系統已掛聯絡逆天重裝Win10!</TextBlock>                </Border>                <!--底部-->                <Border BorderBrush="Black"                 BorderThickness="2"                CornerRadius="0,0,10,10"                VerticalAlignment="Bottom"                Height="30">                    <!--底部按鍵-->                    <Grid>                        <SymbolIcon Symbol="Back" HorizontalAlignment="Left" Margin="50,0,0,0" Width="50" />                        <SymbolIcon Symbol="Home" HorizontalAlignment="Center" Width="50" />                        <SymbolIcon Symbol="Zoom" HorizontalAlignment="Right" Margin="0,0,50,0" Width="50" />                    </Grid>                </Border>            </Grid>        </Border>    </Grid></Page>

 

WPF

效果:(邊框想要div必須注意==>WindowStyle="None" Background="Transparent" AllowsTransparency="True" MouseLeftButtonDown="DragWindow")

代碼:

<Window x:Class="WaterMarkAPP.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        Title="浮水印工具" Height="545" Width="298" Background="Transparent" AllowsTransparency="True"         WindowStyle="None" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" MouseLeftButtonDown="DragWindow">    <!--快樂玩耍:DIV一個手機-->    <!--手機整體-->    <Border BorderBrush="Green"             Background="Black"            BorderThickness="4"            CornerRadius="10,10,10,10">        <Grid>            <!--主畫面-->            <Border BorderBrush="Gray"                 BorderThickness="2"                Margin="10,50,10,40">                <Grid Background="#FF151515">                    <Grid.RowDefinitions>                        <RowDefinition></RowDefinition>                        <RowDefinition></RowDefinition>                        <RowDefinition></RowDefinition>                        <RowDefinition></RowDefinition>                        <RowDefinition></RowDefinition>                    </Grid.RowDefinitions>                    <TextBlock FontFamily="微軟雅黑">對不起,系統已掛請聯絡逆天重裝Win10!</TextBlock>                    <Button Grid.Row="1" Opacity="0.4"  HorizontalAlignment="Center" VerticalAlignment="Center" Height="50" Width="100" Click="Button_Click">單個浮水印</Button>                    <Button Grid.Row="2" Opacity="0.4"  HorizontalAlignment="Center" VerticalAlignment="Center" Height="50" Width="100" Click="Button_Click_1">批量浮水印</Button>                    <Button Grid.Row="3" Opacity="0.4"  HorizontalAlignment="Center" VerticalAlignment="Center" Height="50" Width="100" Click="Button_Click_2">關閉程式</Button>                </Grid>            </Border>            <!--底部-->            <Border BorderBrush="Black"                 BorderThickness="2"                CornerRadius="0,0,10,10"                VerticalAlignment="Bottom"                Height="40">                <!--底部按鍵-->                <Grid>                    <TextBlock Text="毒" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="80,0,0,0" Width="20" Foreground="Gray" MouseLeave="TextBlock_MouseLeave" />                    <TextBlock Text="逆" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" Foreground="Gray"  MouseLeave="TextBlock_MouseLeave_1"/>                    <TextBlock Text="天" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,80,0" Width="20" Foreground="Gray"  MouseLeave="TextBlock_MouseLeave_2"/>                </Grid>            </Border>        </Grid>    </Border></Window>

擴:DragWindow事件

WP、Win10開發或者WPF開發時繪製自訂表單~例如:一個手機

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.