Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If Shift = 4 And KeyCode = 77 Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End If End Sub
第一步必須設定from中的keypreview屬性設為true再添加以下代碼 Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If Shift = 4 And KeyCode = 77 Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End If End Sub
老大,不好使呀?(是ALT+M) Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If Shift = 4 And KeyCode = 77 Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End If End Sub 帮帮忙。
不对,光标在text1时才好使,我想是在窗体下就好使呀。
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If Shift = 4 And KeyCode = 77 Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) Text1.SetFocus'加这个 End If End Sub
If Shift = 4 And KeyCode = 77 Then
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = 4 And KeyCode = 77 Then
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = 4 And KeyCode = 77 Then
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End If
End Sub
帮帮忙。
If Shift = 4 And KeyCode = 77 Then
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus'加这个
End If
End Sub