一个很简单的登入对话框。增加textbox控件,但是运行后,鼠标点击文本输入框,整个界面就最小化了。using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;namespace jiay
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string straccount = "";
public string strpwd= "";
private void account_TextChanged(object sender, EventArgs e)
{
} private void login_Click(object sender, EventArgs e)
{
straccount = account.Text;
strpwd = password.Text;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;namespace jiay
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string straccount = "";
public string strpwd= "";
private void account_TextChanged(object sender, EventArgs e)
{
} private void login_Click(object sender, EventArgs e)
{
straccount = account.Text;
strpwd = password.Text;
}
}
}
本来想按这个办法,发现vs2010.net没有textBoxName.attributes这个了。
Add Attributes:
textBoxName.Attributes["onclick"]="return focusIt(this)";