就像sap那样的效果
我估计这个控件需要重写
不知道怎么写啊

解决方案 »

  1.   

    to textbox 控件怎么实现在按了tab控件自动弹出一个窗体?是在TextBox中按了tab键后弹出窗体吗?
    如果是的话,参看
    http://community.csdn.net/Expert/TopicView.asp?id=4759807
    中我的方法。由于你知道按键具体是什么,那么可以直接在其中进行处理。
      

  2.   

    //MyTextbox class
    public delegate void TextBoxKeyPress( Keys keyCode );
    public class MyTextBox:TextBox
    {
    private TextBoxKeyPress myKeyPress = null;
    private const int WM_KEYDOWN = 0x100;
    public override bool PreProcessMessage(ref Message msg)
    {
    Keys keyCode = (Keys)(int)msg.WParam & Keys.KeyCode; 
    if(msg.Msg == WM_KEYDOWN ) 

    if( keyCode == Keys.Tab )
    {
    myKeyPress( keyCode );
    return true; 
    }
    }  return base.PreProcessMessage (ref msg);
    } public TextBoxKeyPress TxtKeyPress
    {
    set{ myKeyPress = value; }
    }}// in your form
    private void OpenWin( Keys keyCode )
    {
    MessageBox.Show( keyCode.ToString() );
    }// define your textbox 
    private MyTextBox textBox1;// init your textbox
    this.textBox1 = new MyTextBox();
    this.textBox1.TxtKeyPress = new TextBoxKeyPress( OpenWin );