函数如下:
Function CustomerShortcutKey(KeyCode As Integer, Shift As Integer)
On Error Resume Next
Dim intOldSelStart As Integer
Dim ctl As Control
Set ctl = Screen.ActiveControl
If Shift = acAltMask Then
intOldSelStart = ctl.SelStart
Select Case KeyCode
Case vbKeyQ
ctl.SelText = "Φ"
Case vbKeyX
ctl.SelText = "×"
End Select
ctl.SelStart = intOldSelStart + 1
End If
End Function
在窗体的KeyUp事件中调用:
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
CustomerShortcutKey KeyCode, Shift
End Sub
[attach]30011[/attach]作者: chenwm1973 时间: 2008-5-16 14:23
学习..........[:50] [:50] [:50]