Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / February 2006

Tip: Looking for answers? Try searching our database.

Bold Text in RichText Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JamesJ - 09 Feb 2006 12:18 GMT
I'm attempting to toggle SelBold in a richtext control using
Ctrl-B but haven't had any luck.
Apparently there's no KeyDown event for a RichText Control
and I'm not sure of the proper syntax for key combinations in vb
so that's probably wrong also.

Private Sub axcRichText_KeyDown(KeyCode As Integer, Shift As Integer)

     If KeyCode = vbKeyControl And vbKeyB Then

           Me!axcRichText.SelBold = Not Me!axcRichText.SelBold

    End If

End Sub

Any help will be appreciated.
James
Alex Dybenko - 09 Feb 2006 15:48 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.