Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 3rd, 2004, 12:33 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default KeyPress Event in VB different from VBA

I am porting my VBA Outlook code to VB6 and run into problems with the KeyPress Event; this does not work in VB6 for me:

Private Sub Text1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    MsgBox "test"
End Sub

I get this message:
Procedure declaration does not match description of event or procedure having same name

What am I doing wrong?

PaulG

Reply With Quote
  #2 (permalink)  
Old February 3rd, 2004, 12:37 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

that's not the declaration for the keypress event in Vb6..

try commenting the code.. and look at the combo for the correct declaration for the event...

HTH...

Gonzalo Bianchi
Reply With Quote
  #3 (permalink)  
Old February 3rd, 2004, 01:14 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Gonzalo,

I am afraid I do not understand what you try to say.
If I go to the code of the form and pull down the keypress event, this is what I get, and it is not far off from what I initially used. The problem however is that this is not using Returninteger or anything that demands user input.

Private Sub Form_KeyPress(KeyAscii As Integer)
    '
End Sub

PaulG

Reply With Quote
  #4 (permalink)  
Old February 3rd, 2004, 01:31 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

anyway.. the last one is the way that should be declare.. even if you dont use returninteger...

and is really diferent..

they are two different types of variables.. i don't know how returninteger works.. you should use the one from the combo box...

Gonzalo Bianchi
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASCII code on keypress event ashokkumar .NET Framework 1.x 9 March 29th, 2007 07:50 AM
how do i assign keypress event on F2 kau_shuk VS.NET 2002/2003 1 August 25th, 2006 08:49 PM
keypress event kau_shuk VB.NET 2002/2003 Basics 1 July 31st, 2006 11:21 AM
KeyPress event jbenson001 VB.NET 2002/2003 Basics 1 March 24th, 2005 04:52 PM
Keypress Event bharatsaboo VB.NET 2002/2003 Basics 0 February 25th, 2005 03:34 AM



All times are GMT -4. The time now is 05:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.