最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
登陆框控件
时间:2022-07-02 11:53:50 编辑:袖梨 来源:一聚教程网
好久以前作的东西,最近拿出来溜溜,最近一直没有作应用程序方面的东西了,有点生疏! 希望我的这篇东西能对您有所帮助,大家共同探讨共同进步,此文章比较简单!是作一个通用的登陆框控件!
首先建一解决项目LoginControl,添加一个类库的项目LoginControl,然后添加用户控件ctlLogin
然后在ctlLogin.cs文件中写代码
//ctlLogin.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Text;
namespace LoginControl
{
///
/// ctlLogin 的摘要说明。
///
public class ctlLogin : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lHeader;
private System.Windows.Forms.Label lText;
private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.Label lPassword;
private System.Windows.Forms.Label lUsername;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.TextBox txtUsername;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.ErrorProvider errorProvider;
///
/// 必需的设计器变量。
///
private System.ComponentModel.Container components = null;
public event System.EventHandler Successful;
public event System.EventHandler Failed;
private ArrayList strUsername=new ArrayList();
private ArrayList strPassword=new ArrayList();
private int index=-1;
private string ErrMsg = "请输入正确的用户名和密码!";
首先建一解决项目LoginControl,添加一个类库的项目LoginControl,然后添加用户控件ctlLogin
然后在ctlLogin.cs文件中写代码
//ctlLogin.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Text;
namespace LoginControl
{
///
/// ctlLogin 的摘要说明。
///
public class ctlLogin : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lHeader;
private System.Windows.Forms.Label lText;
private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.Label lPassword;
private System.Windows.Forms.Label lUsername;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.TextBox txtUsername;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.ErrorProvider errorProvider;
///
/// 必需的设计器变量。
///
private System.ComponentModel.Container components = null;
public event System.EventHandler Successful;
public event System.EventHandler Failed;
private ArrayList strUsername=new ArrayList();
private ArrayList strPassword=new ArrayList();
private int index=-1;
private string ErrMsg = "请输入正确的用户名和密码!";
相关文章
- 碧蓝航线的里雅斯特期待的便当时间皮肤有什么 04-30
- 明日之后踏浪逐星服装展示攻略 04-30
- 深空之眼幽月塞勒涅刻印搭配核心思路 04-30
- 明日之后红杉茶会护卫队首领BOSS有哪些 04-30
- CF手游段位奖励汇总攻略 04-30
- 无期迷途5-13怎么走攻略 04-30