📄 副本 loginpanel.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace gowk.forms
{
/// <summary>
/// LoginPanel 的摘要说明。
/// </summary>
public class LoginPanel : gowk.controls.GPanel
{
private System.Windows.Forms.LinkLabel linkLabel2;
private System.Windows.Forms.LinkLabel linkLabel1;
private gowk.forms.ProxySetting proxySetting1;
private gowk.forms.Login login1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public LoginPanel()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();
this.proxySetting1.Visible=this.login1.Visible=false;
this.proxySetting1.BorderColor.NormalColor=Color.LightYellow;
this.proxySetting1.BorderColor.ActiveColor=Color.Gold;
this.proxySetting1.BorderColor.PressedColor=Color.LightYellow;
this.login1.BorderColor.NormalColor=Color.LightYellow;
this.login1.BorderColor.ActiveColor=Color.Gold;
this.login1.BorderColor.PressedColor=Color.LightYellow;
// this.BackColor=Color.Transparent;
this.GBorderStyle=gowk.controls.GBorderStyle.Null;
// this.SetStyle(ControlStyles.SupportsTransparentBackColor,true);
this.login1.LoginPanel=this;
this.linkLabel1.MouseEnter+=new EventHandler(linkLabel1_MouseEnter);
this.linkLabel1.MouseLeave+=new EventHandler(linkLabel1_MouseLeave);
this.linkLabel2.MouseEnter+=new EventHandler(linkLabel1_MouseEnter);
this.linkLabel2.MouseLeave+=new EventHandler(linkLabel1_MouseLeave);
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.proxySetting1 = new gowk.forms.ProxySetting();
this.login1 = new gowk.forms.Login();
this.SuspendLayout();
//
// linkLabel2
//
this.linkLabel2.ActiveLinkColor = System.Drawing.Color.White;
this.linkLabel2.BackColor = System.Drawing.Color.Transparent;
this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
this.linkLabel2.LinkColor = System.Drawing.Color.FromArgb(((System.Byte)(179)), ((System.Byte)(199)), ((System.Byte)(244)));
this.linkLabel2.Location = new System.Drawing.Point(24, 56);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(128, 24);
this.linkLabel2.TabIndex = 9;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "点击这里登陆";
this.linkLabel2.VisitedLinkColor = System.Drawing.Color.FromArgb(((System.Byte)(179)), ((System.Byte)(199)), ((System.Byte)(244)));
this.linkLabel2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.linkLabel2_MouseDown);
//
// linkLabel1
//
this.linkLabel1.ActiveLinkColor = System.Drawing.Color.White;
this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
this.linkLabel1.LinkColor = System.Drawing.Color.FromArgb(((System.Byte)(179)), ((System.Byte)(199)), ((System.Byte)(244)));
this.linkLabel1.Location = new System.Drawing.Point(24, 104);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(120, 24);
this.linkLabel1.TabIndex = 11;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "网络设置";
this.linkLabel1.VisitedLinkColor = System.Drawing.Color.FromArgb(((System.Byte)(179)), ((System.Byte)(199)), ((System.Byte)(244)));
this.linkLabel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.linkLabel1_MouseDown);
//
// proxySetting1
//
this.proxySetting1.BackColor = System.Drawing.SystemColors.Info;
this.proxySetting1.GBorderStyle = gowk.controls.GBorderStyle.Solid;
this.proxySetting1.IsRound = true;
this.proxySetting1.Location = new System.Drawing.Point(7, 96);
this.proxySetting1.Name = "proxySetting1";
this.proxySetting1.Size = new System.Drawing.Size(169, 192);
this.proxySetting1.TabIndex = 12;
this.proxySetting1.Visible = false;
//
// login1
//
this.login1.BackColor = System.Drawing.SystemColors.Info;
this.login1.GBorderStyle = gowk.controls.GBorderStyle.Solid;
this.login1.IsRound = true;
this.login1.Location = new System.Drawing.Point(8, 41);
this.login1.Name = "login1";
this.login1.Size = new System.Drawing.Size(168, 136);
this.login1.TabIndex = 13;
this.login1.Visible = false;
//
// LoginPanel
//
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.login1);
this.Controls.Add(this.proxySetting1);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.linkLabel2);
this.Name = "LoginPanel";
this.Size = new System.Drawing.Size(180, 320);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LoginPanel_MouseDown);
this.ResumeLayout(false);
}
#endregion
private void linkLabel2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.proxySetting1.Visible=false;
this.login1.Visible=true;
}
private void LoginPanel_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.proxySetting1.Visible=this.login1.Visible=false;
}
private void linkLabel1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.login1.Visible=false;
this.proxySetting1.Visible=true;
}
private void linkLabel1_MouseEnter(object sender, EventArgs e)
{
Control c=(Control)sender;
c.Font=new Font(this.Font.FontFamily,this.Font.Size+2,FontStyle.Bold);
}
private void linkLabel1_MouseLeave(object sender, EventArgs e)
{
Control c=(Control)sender;
c.Font=new Font(this.Font.FontFamily,this.Font.Size,FontStyle.Regular);
}
internal void InvokeLoginEvent(string uid,string pwd)
{
if(this.Login!=null)this.Login(this,new LoginEventArgs(uid,pwd));
}
internal void InvokeLoginValidate(string uid,string pwd)
{
if(this.LoginValidate!=null)this.LoginValidate(this,new LoginEventArgs(uid,pwd));
}
public event LoginEventHandler Login,LoginValidate;
}
public class LoginEventArgs:System.EventArgs
{
public string UserName,Password;
public LoginEventArgs(string uid,string pwd):base()
{
this.UserName=uid;
this.Password=pwd;
}
}
public delegate void LoginEventHandler(object sender,LoginEventArgs e);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -