当前位置:编程学习 > C#/ASP.NET >>

TextBox和DropDown光标切回问题

我在一个WinForm的Form窗体里面新建了一个Form.里面包含了一个TextBox.然后我逮捕他的 OnEnter事件

代码如下:
    public partial class Form1 : Form
    {
        ToolStripControlHost textbox = new ToolStripControlHost(new TextBox()
        {
            Text = "yanzuoguang",
            BorderStyle = BorderStyle.None
        });
        ToolStripDropDown dropDown = new ToolStripDropDown();

        public Form1()
        {
            InitializeComponent();
            dropDown.Items.Add(textbox);
        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            dropDown.Show(textBox1, 0, textBox1.Height);   //在这里显示后不能继续编辑
        }
    } --------------------编程问答-------------------- 兄弟 什么情况 --------------------编程问答-------------------- 哎  没听懂你也干啥 --------------------编程问答--------------------  ToolStripControlHost textbox = new ToolStripControlHost(new TextBox()
        {
            Text = "yanzuoguang",
            BorderStyle = BorderStyle.None,
            Enabled=false or ReadOnly=True
        }); --------------------编程问答-------------------- 你的意思是? --------------------编程问答-------------------- 这个需要程序跑下,我把源代码放上来 ,稍等 --------------------编程问答-------------------- 源码 --------------------编程问答-------------------- 问题在于假如我逮捕 OnKeyPress事件的时候,并且显示时,无法流畅的进行编辑
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,