AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > VB编程

在GotFocus时快速选择文本

51自学网 http://www.wanshiok.com
Public Sub FocusMe(ctlName As Control)
With ctlName
.SelStart = 0
.SelLength = Len(ctlName)
End With
End Sub

Now add a call to this subroutine in the GotFocus event of the input controls:

Private Sub txtFocusMe_GotFocus()
Call FocusMe(txtFocusMe)
End Sub

 

 

 
上一篇:用EXCEL组件简化VB编程的一种方法  下一篇:用ParamArray接收任意个参数