[英]how to specify an specific texbox to fill in c# in Visual Studio 2012
I have several textboxs and buttons in my C# application . 我的C#应用程序中有几个文本框和按钮。 Im using Microsoft Visual Studio 2012 . 我正在使用Microsoft Visual Studio 2012。 In my app user can add a name to database ! 在我的应用程序中,用户可以为数据库添加名称! for example by pressing Button1 , the name in texbox1 , will insert into database ! 例如,按下Button1,texbox1中的名称将插入数据库! I want afteruser press Button1 , he fill texbox1 again to insert another item without he will have to select texbox1 by mouse or tab ... I want app indicate texbox1 automaticly . 我希望用户按下Button1之后,他再次填充texbox1来插入另一个项目,而不必用鼠标或制表键选择texbox1 ...我希望应用程序自动指示texbox1。
(If I understand you correctly) In the button click event just do something like the below. (如果我对您的理解正确),请在按钮单击事件中执行以下操作。
textBox1.Clear();
if(!textBox1.Focused)
{
textBox1.Focus();
}
(Winforms) (Winforms)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.