B
baobob
My Excel 2002 VB Editor has Microsoft Visual Basic 6.3.
I've been using TreeView months and it works great. Now I want to use
KeyDown. VB 6.3 Help says syntax is:
"Event KeyDown(KeyCode As Integer, Shift As Integer)"
So I have:
[In Form Module UserForm1:]
Private Sub TreeView1_KeyDown(KeyCode As Integer, Shift As Integer)
But the compiler chokes on that line with:
"Procedure declaration does not match description of event or
procedure having the same name" [terminated without punctuation]
Besides the complaint that it'd take only half those words for the
stupid error msg. to tell you what the syntax *is*, I've tried several
variations and they all choke too, e.g.:
Private Sub TreeView1_KeyDown(
ByVal KeyCode As Integer, ByVal Shift As Integer
KeyCode As ReturnInteger, Shift As Integer
ByVal KeyCode As ReturnInteger, ByVal Shift As Integer
KeyCode As MSForms.ReturnInteger, Shift As Integer
ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer
KeyAscii As Integer, Shift As Integer
ByVal KeyAscii As Integer, ByVal Shift As Integer
ByVal
If_You_Want_Me_To_Say_George_Bush_Is_A_Great_President_Then_OK_He_Is
As String
)
Yet right above it in the same module I've been using:
Private Sub TreeView1_KeyPress(KeyAscii As Integer)
and it compiles fine.
Full disclosure dept.: I'm implementing UserForm thru Stephen Bullen's
great CFormChanger, but all he does is set some simple sizing & button
properties & methods at the form level.
What am I doing wrong?
Thanks much.
***
I've been using TreeView months and it works great. Now I want to use
KeyDown. VB 6.3 Help says syntax is:
"Event KeyDown(KeyCode As Integer, Shift As Integer)"
So I have:
[In Form Module UserForm1:]
Private Sub TreeView1_KeyDown(KeyCode As Integer, Shift As Integer)
But the compiler chokes on that line with:
"Procedure declaration does not match description of event or
procedure having the same name" [terminated without punctuation]
Besides the complaint that it'd take only half those words for the
stupid error msg. to tell you what the syntax *is*, I've tried several
variations and they all choke too, e.g.:
Private Sub TreeView1_KeyDown(
ByVal KeyCode As Integer, ByVal Shift As Integer
KeyCode As ReturnInteger, Shift As Integer
ByVal KeyCode As ReturnInteger, ByVal Shift As Integer
KeyCode As MSForms.ReturnInteger, Shift As Integer
ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer
KeyAscii As Integer, Shift As Integer
ByVal KeyAscii As Integer, ByVal Shift As Integer
ByVal
If_You_Want_Me_To_Say_George_Bush_Is_A_Great_President_Then_OK_He_Is
As String
)
Yet right above it in the same module I've been using:
Private Sub TreeView1_KeyPress(KeyAscii As Integer)
and it compiles fine.
Full disclosure dept.: I'm implementing UserForm thru Stephen Bullen's
great CFormChanger, but all he does is set some simple sizing & button
properties & methods at the form level.
What am I doing wrong?
Thanks much.
***