登陆框控件
来源:互联网 发布:淘宝有逆战招打手的吗 编辑:程序博客网 时间:2024/05/29 13:45
好久以前作的东西,最近拿出来溜溜,最近一直没有作应用程序方面的东西了,有点生疏! 希望我的这篇东西能对您有所帮助,大家共同探讨共同进步,此文章比较简单!是作一个通用的登陆框控件!
首先建一解决项目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 = "请输入正确的用户名和密码!";
public ctlLogin()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();
// TODO: 在 InitializeComponent 调用后添加任何初始化
strUsername.Clear();
strPassword.Clear();
}
///
/// 清理所有正在使用的资源。
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region 组件设计器生成的代码
///
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
///
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ctlLogin));
this.panel1 = new System.Windows.Forms.Panel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.lText = new System.Windows.Forms.Label();
this.lHeader = new System.Windows.Forms.Label();
this.btnLogin = new System.Windows.Forms.Button();
this.lPassword = new System.Windows.Forms.Label();
this.lUsername = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
this.txtUsername = new System.Windows.Forms.TextBox();
this.errorProvider = new System.Windows.Forms.ErrorProvider();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Controls.Add(this.lText);
this.panel1.Controls.Add(this.lHeader);
this.panel1.Location = new System.Drawing.Point(4, 4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(480, 52);
this.panel1.TabIndex = 0;
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(432, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(40, 32);
this.pictureBox1.TabIndex = 6;
this.pictureBox1.TabStop = false;
//
// lText
//
- 登陆框控件
- 登陆框控件
- 登陆框控件
- 登陆控件
- Ajax 登陆控件
- 一个简单的登陆控件
- 打造登陆控件(转载)
- membership重新定义登陆控件
- WinForm基础控件---登陆实例
- 点击登陆 弹出登陆框
- 被迫写一个类似qq登陆框上面的那个下拉框控件
- 写一个登陆用的用户控件。
- ASP.NET 2.0中的登陆控件简介
- ASP.NET 2.0中的登陆控件简介
- ASP.NET 2.0中的登陆控件简介
- ASP.NET 2.0中的登陆控件简介
- ASP.NET 2.0中的登陆控件简介
- ASP.NET 2.0中的登陆控件简介
- Lua的反射
- python中 逗号的 用法
- python中 逗号的 用法
- ORACLE WHER条件的执行顺序是不是自右向左
- 博科资讯:C2B模式是未来电商及电商管理系统的发展之道
- 登陆框控件
- Android中,SD卡上的媒体文件(图片、视频)的改变与通知
- 2938: 字母旋转游戏
- 后台遍历一个HTML页面
- 设计模式在C中的应用方式
- .net的MSMQ异步调用
- 诊断
- 长沙降温8.5℃ 男子盗窃后杀害漂亮女白领
- [codility]FrogRiverOne