当前位置:网站首页>WPF project introduction 1 - Design and development of simple login page
WPF project introduction 1 - Design and development of simple login page
2022-07-25 12:17:00 【Jinan medical applet champion】
Look at the effect

Code up
1 Default startup page code
<Application x:Class="WpfApp2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApp2"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

2 Front end layout , Set up , Control use , And button double click , Add event code
<Window x:Class="WpfApp2.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:WpfApp2"
mc:Ignorable="d"
Title=" The login page " Height="294.5" Width="374.5" ShowInTaskbar="False"
WindowStartupLocation="CenterScreen" WindowState="Maximized" Topmost="True" Icon="Imgs/logoyun.png"
>
<!-- Grid type Row and column Layout control Grid Window Of Content Content -->
<Grid Margin="0,0,-91,-67">
<!--Content Property to set the text content 1 Content=" Sign in " Set the text value content 2 Ways of planting ,2 Write between the text .3 label Control writing method Realization -->
<Button Name="btnLogin" HorizontalAlignment="Left" Margin="104,172,0,0" VerticalAlignment="Top"
Width="50" Content=" Sign in " Click="btnLogin_Click">
<!--<Label Content=" Sign in " HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
<Label.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-0.464"/>
<TranslateTransform/>
</TransformGroup>
</Label.RenderTransform>
</Label>-->
</Button>
<Label Name="lbluName" Content=" account number :" HorizontalAlignment="Left"
Margin="93,88,0,0" VerticalAlignment="Top" Width="108"/>
<TextBox Name="txtUName" HorizontalAlignment="Left" Height="23" Margin="139,90,0,0"
TextWrapping="NoWrap"
Text="admin" VerticalAlignment="Top" Width="120"/>
<Label Content=" password :" HorizontalAlignment="Left"
Margin="93,118,0,0" VerticalAlignment="Top" Width="108"/>
<PasswordBox Name="txtUPwd" HorizontalAlignment="Left" Height="23" Margin="139,122,0,0"
Password="123456" PasswordChar="*" VerticalAlignment="Top" Width="120"/>
<Button Name="btnConcel"
Content=" Cancel " HorizontalAlignment="Left"
Margin="184,172,0,0" VerticalAlignment="Top" Width="50"
Click="BtnCancel_Click"/>
</Grid>
<!-- The root node window-->
</Window>
3 C# Class code , Registration of button events
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;
namespace WpfApp2
{
/// <summary>
/// MainWindow.xaml Interaction logic of
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnLogin_Click(object sender, RoutedEventArgs e)
{
// Control's event registration
}
private void BtnCancel_Click(object sender, RoutedEventArgs e)
{
}
}
}
Activation effect

边栏推荐
- [dark horse morning post] eBay announced its shutdown after 23 years of operation; Wei Lai throws an olive branch to Volkswagen CEO; Huawei's talented youth once gave up their annual salary of 3.6 mil
- R语言使用wilcox.test函数执行wilcox符号秩检验获取总体中位数(median)的置信区间(默认输出结果包括95%置信水平的置信区间)
- Data transmission under the same LAN based on tcp/ip
- Atomic atomic class
- web编程(二)CGI相关
- 【AI4Code最终章】AlphaCode:《Competition-Level Code Generation with AlphaCode》(DeepMind)
- Intelligent information retrieval (overview of intelligent information retrieval)
- [comparative learning] understanding the behavior of contractual loss (CVPR '21)
- Brpc source code analysis (I) -- the main process of RPC service addition and server startup
- 客户端开放下载, 欢迎尝鲜
猜你喜欢

【对比学习】Understanding the Behaviour of Contrastive Loss (CVPR‘21)

Web programming (II) CGI related

【Debias】Model-Agnostic Counterfactual Reasoning for Eliminating Popularity Bias in RS(KDD‘21)

Basic concepts of NLP 1

【多模态】《TransRec: Learning Transferable Recommendation from Mixture-of-Modality Feedback》 Arxiv‘22

Start with the development of wechat official account

记录一次线上死锁的定位分析

Hydrogen entrepreneurship competition | Liu Yafang, deputy director of the science and Technology Department of the National Energy Administration: building a high-quality innovation system is the cor

Solutions to the failure of winddowns planning task execution bat to execute PHP files

Brpc source code analysis (V) -- detailed explanation of basic resource pool
随机推荐
Transformer variants (spark transformer, longformer, switch transformer)
R language ggplot2 visualization: visualize the scatter diagram, add text labels to some data points in the scatter diagram, and use geom of ggrep package_ text_ The repl function avoids overlapping l
【AI4Code】《Pythia: AI-assisted Code Completion System》(KDD 2019)
【GCN-RS】MCL: Mixed-Centric Loss for Collaborative Filtering (WWW‘22)
【AI4Code】《InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees》ICSE‘21
R语言使用ggpubr包的ggarrange函数将多幅图像组合起来、使用ggexport函数将可视化图像保存为jpeg格式(width参数指定宽度、height参数指定高度、res参数指定分辨率)
【AI4Code】《GraphCodeBERT: Pre-Training Code Representations With DataFlow》 ICLR 2021
MySQL练习二
Knowledge maps are used to recommend system problems (mvin, Ctrl, ckan, Kred, gaeat)
Solutions to the failure of winddowns planning task execution bat to execute PHP files
【微服务~Sentinel】Sentinel降级、限流、熔断
循环创建目录与子目录
【多模态】《HiT: Hierarchical Transformer with Momentum Contrast for Video-Text Retrieval》ICCV 2021
【6篇文章串讲ScalableGNN】围绕WWW 2022 best paper《PaSca》
[high concurrency] a lock faster than read-write lock in high concurrency scenarios. I'm completely convinced after reading it!! (recommended Collection)
R language ggpubr package ggarrange function combines multiple images and annotates_ Figure function adds annotation, annotation and annotation information for the combined image, adds image labels fo
【多模态】《TransRec: Learning Transferable Recommendation from Mixture-of-Modality Feedback》 Arxiv‘22
Video caption (cross modal video summary / subtitle generation)
scrapy爬虫爬取动态网站
R语言可视化散点图、使用ggrepel包的geom_text_repel函数避免数据点之间的标签互相重叠(设置min.segment.length参数为Inf不添加标签线段)