专注于C#中的TextBox [英] Focusing on a TextBox in C#

查看:92
本文介绍了专注于C#中的TextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

选中复选框后,如何使光标移动到文本框中?

How do I make the cursor move into a textbox after I''ve checked a checkbox?

推荐答案

您的问题是什么?你的消息没有意义. :confused:
What is your question? Your messge does not make sense. :confused:


私有无效checkBox_CheckedChanged(对象发送者,EventArgs e)
{
TextBox1.Focus();
}
private void checkBox_CheckedChanged(object sender, EventArgs e)
{
TextBox1.Focus();
}


您好,罗摩克里希纳,
请问这个问题更容易理解.我认为您的要求是在单击复选框后将光标设置在特定的文本框上.为此,请为复选框的Click事件添加事件处理程序,并在文本框内调用文本框的Focus事件.事件处理程序

Hi Ramakrishna,
Please ask the question more understandable.I think your requirement is to set the cursor on a specific textbox after clicking the checkbox.For doing this, Add the event handler for Click event of check box and call the textbox''s Focus event inside the event handler

private void checkBox1_Click(object sender, EventArgs e)
   {
     urTextboxName.Focus();
   }



Vineeth



Vineeth


这篇关于专注于C#中的TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆