每當我將焦點設置到WinForms(.NET 3.5)中的文本框時,整個文本被選中。如果將MultiLine設置爲true或false,則無關緊要。似乎正是這個用戶是看到的完全相反: Making a WinForms TextBox behave like your browser's address bar.NET - WinForm文本框 - 焦點和SelectedText
我試圖做:
private void Editor_Load(object sender, EventArgs e)
{
//form load event
txtName.SelectedText = String.Empty; // has no effect
}
有另一種屬性我可以設置爲阻止這種令人討厭的行爲?
我只注意到這個工程:
txtName.Select(0,0);
txtScript.Select(0,0);
但我真的需要我所有的文本框調用select()?
看評論凱爾Rozendo。 – BuddyJoe 2009-09-08 18:20:18