简体   繁体   English

如何在Visual Studio 2012中指定特定的texbox填充c#

[英]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.

相关问题 如何在Visual Studio / WPF / C#中创建“分配按钮” texbox? - How to create a “assign button” texbox in visual studio / wpf / c#? 从组合框到texbox的C#Visual Studio项目 - C# Visual Studio Item from combobox to texbox 如何在Visual Studio 2012 C#项目中使用SQLConfigDataSource - How to Use SQLConfigDataSource in a Visual Studio 2012 C# Project 如何将C#安装到Visual Studio 2012 Ultimate - How To Install C# to Visual Studio 2012 Ultimate 在c#下使用Visual Studio 2012创建.sql脚本,以及如何运行它? - create .sql script with Visual Studio 2012 at c# and how run it? 如何在Win 7 visual Studio 2012中的C#中禁用#if DEBUG - how to disable #if DEBUG in C# at Win 7 visual studio 2012 从C#和Visual Studio 2012中的Paint事件处理程序外部修改填充颜色 - Modify Fill Colour from Outside a Paint Event Handler in C# and Visual Studio 2012 如何在Visual Studio 2012中部署具有所有依赖项的C#项目 - How to Deploy c# project with all dependencies in visual studio 2012 C#Visual Studio 2012如何显示类成员和方法? - C# Visual Studio 2012, how to show class members and methods? 如何在Visual Studio 2012 C#上更新我的数据源? - How to update my data sources on visual studio 2012 c#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM