Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I'm trying to get the KeyDown event to fire on a RichTextBox. Here's my test code... Private Sub Richtextbox1_Keydown(KeyCode As Integer, Shift As Integer) MsgBox "hello" End Sub This is how it would be written in VB. Any suggestions for VBA?? Perhaps I need additional references?? Thanks! Trip |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Trip,
Your code works as expected for me. First I get the msgbox then whatever key gets added to the text (where the cursor was) in the RTB. If you are distributing a vba project with a RichTextBox control you might be interested to read this thread http://tinyurl.com/ayu97 Regards, Peter T "Trip" wrote in message oups.com... Hi all, I'm trying to get the KeyDown event to fire on a RichTextBox. Here's my test code... Private Sub Richtextbox1_Keydown(KeyCode As Integer, Shift As Integer) MsgBox "hello" End Sub This is how it would be written in VB. Any suggestions for VBA?? Perhaps I need additional references?? Thanks! Trip |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I should have pasted your code rather than adding the event from the
dropdown. Your example is missing "ByVal" before the Shift Private Sub Richtextbox1_Keydown(KeyCode As Integer, Shift As Integer) Private Sub Richtextbox1_Keydown(KeyCode As Integer, ByVal Shift As Integer) Regards, Peter T "Peter T" <peter_t@discussions wrote in message ... Hi Trip, Your code works as expected for me. First I get the msgbox then whatever key gets added to the text (where the cursor was) in the RTB. If you are distributing a vba project with a RichTextBox control you might be interested to read this thread http://tinyurl.com/ayu97 Regards, Peter T "Trip" wrote in message oups.com... Hi all, I'm trying to get the KeyDown event to fire on a RichTextBox. Here's my test code... Private Sub Richtextbox1_Keydown(KeyCode As Integer, Shift As Integer) MsgBox "hello" End Sub This is how it would be written in VB. Any suggestions for VBA?? Perhaps I need additional references?? Thanks! Trip |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bingo!! Sorry for the additional post - this came in as I was writing.
Thanks! That did it! Trip |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for checking-out my code Peter! I have the RICHTX32.OCX
reference, yet, when I try to launch the form I get: "Compile error: procedure declaration does not match description of event or procedure haveing the same name" Any further ideas?? Thanks, Trip |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for checking-out my code Peter! I have the RICHTX32.OCX
reference, yet, when I try to launch the form I get: "Compile error: procedure declaration does not match description of event or procedure haveing the same name" Any further ideas?? Thanks, Trip |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
worksheet change event not working | Excel Discussion (Misc queries) | |||
before print event not working | Excel Programming | |||
Workbook_Open event not working | Excel Programming | |||
Worksheet_Change Event Not Working | Excel Programming |