Hi,
you should use Shift variable in order to detect control key, and perhaps
use KeyUp event:
If KeyCode = vbKeyB And shift= 2 Then
'ctrl+b pressed
...

Signature
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> I'm attempting to toggle SelBold in a richtext control using
> Ctrl-B but haven't had any luck.
[quoted text clipped - 14 lines]
> Any help will be appreciated.
> James
JamesJ - 09 Feb 2006 17:53 GMT
I used the following code but nothing happens
when I press ctrl+b
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyB And Shift = 2 Then
Me!axcRichText.SelBold = Not Me!axcRichText.SelBold
End If
End Sub
> Hi,
> you should use Shift variable in order to detect control key, and perhaps
[quoted text clipped - 22 lines]
>> Any help will be appreciated.
>> James
JamesJ - 09 Feb 2006 17:57 GMT
Sorry, KeyPreview was No. Works fine now.
Thanks,
James
>I used the following code but nothing happens
> when I press ctrl+b
[quoted text clipped - 34 lines]
>>> Any help will be appreciated.
>>> James