using System;using System.Drawing;using System.Windows.Forms; namespace 案例演示{ public partial class frmlogo : Form { public frmlogo() { InitializeCompo ...
using System;
using System.Drawing;
using System.Windows.Forms;
namespace 案例演示
{
public partial class frmlogo : Form
{
public frmlogo()
{
InitializeComponent();
}
int usi,pwi;
private void frmlogo_Load(object sender, EventArgs e)
{
}
private void textBox1_MouseDown(object sender, MouseEventArgs e)
{
usi++;
if (usi==1)
{
textBox1.Text = "";
}
if (textBox2.Text=="")
{
pwi = 0;
textBox2.Text = "密碼";
}
}
private void textBox2_MouseDown(object sender, MouseEventArgs e)
{
pwi++;
if (textBox1.Text=="")
{
textBox1.Text = "用戶名";
usi = 0;
}
if (pwi==1)
{
textBox2.Text = "";
}
}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
textBox1.ForeColor = Color.Black;
}
private void textBox2_KeyDown(object sender, KeyEventArgs e)
{
textBox2.ForeColor = Color.Black;
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
2017-09-02