加载表单后,窗体中的文本框控件没有输入。 [英] Textbox control in windows form is not taking input after the form is loaded.

查看:137
本文介绍了加载表单后,窗体中的文本框控件没有输入。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



任何人都可以告诉我为什么文本框控件在加载表单时不会输入任何内容。我有一个表单,我在其中添加了此菜单条控件和工具条控件。当我从menustrip点击文件菜单中的新文件选项时,会打开一个包含文本框,组合框,数据网格等的新表单。如果我这样做,新表单中的文本框将接受输入(接受键盘输入的字符)。但是如果我使用工具栏按钮打开一个新表单,文本框不会响应键盘的输入,在我从任何组合框控件中选择一个项目然后在文本框控件中输入文本它接受输入。我为什么要面对这样的问题?为menustrip newfile事件和toolstrip新文件buttonclick事件编写的代码是完全相同的,所以任何帮助将不胜感激。



提前感谢。

Hi all,

Can anybody tell me why does the textbox control does not take any input when the form is loaded. I have a form in which i have this menu strip control & tool strip control added to it. A new form is opened which contains textboxes, combobox, datagrid & so on, when i click on new file option in file menu from the menustrip. If i do that way the textboxes in the new form takes input(accepts characters typed from keyboard). But if i use toolstrip button to open a new form, the textboxes wont respond to the inputs from the keyboard & after i select an item from any of the combobox control & then enter text in textbox control it accepts the input. Why am i facing such a problem? The code written for menustrip newfile event & toolstrip new file buttonclick event is absolutely same, so any help will be appreciated.

Thanks in advance.

推荐答案

可能将它们的属性设置为ReadOnly以开始,并且menustrip的代码启用它们。某处您要么禁用它们,要么启用它们。您需要查看代码以找出问题的位置,因为我们无法看到您拥有的内容。
It's possible their properties are set to ReadOnly to start with and the code for the menustrip enables them. Somewhere you are either disabling them or enabling them. You'll need to look through the code to find where the issue is since we can't see what you have.


这篇关于加载表单后,窗体中的文本框控件没有输入。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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