WebForm?
给你的TextBox加上onblur事件,用js实现

解决方案 »

  1.   

    <asp:TextBox runat="server" id="TextBox1" Alignment="center"
          OnTextChanged="TextChanged" />void TextChanged(object sender, EventArgs e )
    {
       DataRow drw = DataTable1.Select("ID=" + this.TextBox1.Text)[0];
       this.TextBox1.Text = drw.Item["name"].ToString();
    }建议多加尝试!!!
      

  2.   

    是onmouseout吧  再用js写
      

  3.   

    TextBox_TextChanged这种方式容易实现,但会整个页面刷新而引起闪烁,效果不怎么好;
    建议用js,客户端还是少不了脚本的;只用服务器控件的话,在客户端的效果比较难把握,就像页面闪烁.
      

  4.   

    这个当然用leave属性啊.private void textBox_Leave(object sender, System.EventArgs e)
    {
        listBox1.Items.Add(((TextBox)sender).Text);
    }
    编译代码
    本示例需要: 含有一个名为 listBox1 的 ListBox 控件和三个 TextBox 控件(textBox1、textBox2 和 textBox3)的一个窗体。将每个 TextBox 的 Leave 事件处理程序设置为 textBox_Leave