WPF中做出一个QQ登陆界面

Xaml:

"ChatSoftware.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:ChatSoftware"
        mc:Ignorable="d"
        Title="MainWindow" Height="603.659" Width="994.776">
    
        "Key_Number"/>
        "Key_Fruits"/>
    
    "Left" Height="560" Margin="10,10,0,0" VerticalAlignment="Top" Width="975">
        
            "Resources/timg (3).jpg"/>
        
        
            "400"/>
            
        
        "Left" Height="204" Margin="192,119,0,0" VerticalAlignment="Top" Width="601" Grid.Column="200">
            "202" Background="Transparent" Margin="0,0,-100.2,0">
                
                    
                    
                    "50"/>
                
                
                    "200"/>
                    
                    
                
                "Left" Height="135" Margin="36,36,0,0" Grid.RowSpan="3" VerticalAlignment="Top" Width="137" Source="Resources/2.jpg" RenderTransformOrigin="0.513,0.666" Stretch="Fill"/>
                "White" DataContext="{StaticResource Key_Number}" ItemsSource="{Binding Items, Source={StaticResource Key_Number}}" SelectedIndex="0" Grid.Column="1" HorizontalAlignment="Left" Margin="34,36,0,0" VerticalAlignment="Top" Width="301" Height="40" Grid.ColumnSpan="2" BorderBrush="#FFC0EBCB" IsEditable="True" FontSize="18"/>
                "记住密码" Grid.Column="1" HorizontalAlignment="Left" Margin="34,10,0,0" Grid.Row="2" VerticalAlignment="Top" Height="30" Width="115" FontSize="16" FontStyle="Oblique" Foreground="#FFD7C73B"/>
                "自动登陆" Grid.Column="2" HorizontalAlignment="Left" Margin="20.8,9.8,0,0" Grid.Row="2" VerticalAlignment="Top" Height="30" RenderTransformOrigin="0.438,1.063" FontSize="16" Foreground="#FF9174BF"/>
                "1" MaxLength="15" HorizontalAlignment="Left" Margin="34,28,0,0" Grid.Row="1" VerticalAlignment="Top" Height="38" Grid.ColumnSpan="2" Width="301" FontSize="18"/>
                "2" HorizontalAlignment="Right" Margin="0,36,9.8,0" TextWrapping="Wrap" Text="" Width="122" Height="40" VerticalAlignment="Top" FontSize="18">
                    "http://www.baidu.com" Click="Hyperlink_Click"
                       >注册账号
                

            
        
        "Black" BorderThickness="1" HorizontalAlignment="Left" Height="100" Margin="360,10,0,0" Grid.Row="1" VerticalAlignment="Top" Width="293" CornerRadius="20" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}">
            

后台:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;

namespace ChatSoftware
{
    /// 
    /// MainWindow.xaml 的交互逻辑
    /// 
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

        }

        private void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
            Hyperlink link = sender as Hyperlink;

            Process.Start(new ProcessStartInfo(link.NavigateUri.AbsoluteUri));
        }
    }

}

Class(Number):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChatSoftware
{
    public class Number
    {
        public Number()
        {
            Items = new List<string>
            {
                "1308531510",
                "2569875222",
                "5648999998",
                "2415645616",
            };
        }

        public List<string> Items { get; set; }
    }
}

效果图:

WPF中做出一个QQ登陆界面_第1张图片

 

转载于:https://www.cnblogs.com/Leozi/p/10816985.html

你可能感兴趣的:(WPF中做出一个QQ登陆界面)