1.在html页面中天机textBox控件
<span style="font-size:18px;"><asp:TextBox ID="txtSupplier" runat="server" Text="优加" onMouseOver="this.focus();this.select()"></asp:TextBox></span>
2.在窗体加载事件中添加代码
<span style="font-size:18px;">txtSupplier.Attributes.Add("onfocus", "this.Focus()");</span>
这样就很简单的实现了当鼠标滑过文本框时全选的效果。