Tạo giao diện Aero Style.


<Window x:Class="AeroStyle.MainWindow"
        Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" BorderThickness="1,1,1,1" WindowStyle="None" MouseDown="Window_Mousedown">
        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
            <GradientStop Color="#4CA2A2A2" Offset="0"/>
            <GradientStop Color="#4CA2A2A2" Offset="1"/>
            <GradientStop Color="#60B4B4B4" Offset="0.246"/>
            <GradientStop Color="#60FFFFFF" Offset="0.42"/>
            <GradientStop Color="#60E7E7E7" Offset="0.67"/>
            <GradientStop Color="#60FFFFFF" Offset="0.835"/>

Đoạn mã sau dùng để tạo bóng đổ:



Sau đó, xử lý event MouseClick của window:

                private void Window_Mousedown(object sender, MouseButtonEventArgs e)
            if (e.LeftButton == MouseButtonState.Pressed)

Cuối cùng, ta được kết quả:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.