不能使用鼠标单击在文本框中跳转光标。 [英] can not use mouse click to jump cursor in textbox.

查看:109
本文介绍了不能使用鼠标单击在文本框中跳转光标。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我有mdiform的问题。

示例:

我的项目有两个表单(Form1和Form2)

- form1有一个按钮和一个面板。

- form2有一个文本框

当我点击form1上的按钮时然后在form1的面板中显示form2,

现在我将数据输入到文本框中但我不能使用鼠标在文本框中跳转光标。



代码如下:



Hi all!

I have problem with mdiform.
Example:
My project have two form (Form1 and Form2)
- form1 have a button and a panel.
- form2 have a textbox
when I click button on form1 then show form2 in panel of form1,
now i input data into textbox but i can not use mouse to jump cursor in textbox.

code following:

private void button1_Click(object sender, EventArgs e)
{
   Form2 frm2 = new Form2();
   frm2.MdiParent = this;
   frm2.Parent = this.panel1;
   frm2.Show();
}





请帮助我。

谢谢!



Please, help me.
thanks!

推荐答案

此代码出现在鼠标单击中。你如何期望这个代码对文本框做任何事情,当它创建一个新表单并显示它时,仅此而已?
This code occurs within the mouse click. How do you expect this code to do anything with a textbox, when it's creating a new form and showing it, nothing more ?


这是精神错乱。如果您输入文本框,那么文本框显然具有焦点。您的代码段仍然无用,是人们混淆的根源。这没有理由不起作用,把重点放在文本框上也没有用,它已经有了重点。



它会更容易回答如果您编辑帖子而不是按回答发布明显不是答案的内容。
This is insanity. The textbox obviously has the focus if you are typing in to it. Your code snippet continues to be useless, and a source of confusion to people. There's no reason for this not to work, and setting the focus on the textbox is not going to help, it has the focus already.

It would be easier to answer you if you'd edit your post instead of pushing 'answer' to post something that is plainly NOT an answer.


您的文本框是否只读?这可能是问题
Is your textbox readonly? That may be the problem


这篇关于不能使用鼠标单击在文本框中跳转光标。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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