可以使用文本框的SelStart和SelLength属性。
例:
'''''''''''''''''''''''''''''''''''''''''''''
'文件框的按键事件
Private Sub txt_KeyPress(KeyAscii As Integer) 
    
    '判断当前按的是不是回车键
    If KeyAscii = 13 Then
        
        '选中文本框中的所有文字 
        txt.SelStart = 0 
        txt.SelLength = Len(txt.Text) 
        
        txt.SetFocus 
    End If 
End Sub
'''''''''''''''''''''''''''''''''''''''''''''										
					
	
	
	
			
 
											






 
	    

