There is a bug with KeyCode = 0

The place for threads about TimoSoft EditControls.
Post Reply
Rucksacktraeger
Lieutenant
Posts: 23
Joined: 15 Aug 2010, 08:42

There is a bug with KeyCode = 0

Post by Rucksacktraeger »

Hi Timo,

I could not register at the bugtracker. That is why I write here.

I am on the way to replace the FM20 Controls in my Project by yours because they display Khmer (Language and Scropt of Cambodia) in Unicode always correct. The FM20 Controls display sometimes wrong.

But there is a bug! KeyCode = 0 does not work as it should.

Start a new project, add EditControls 1.4 (Unicode), place a Textbox1 on the form and write this code:

Code: Select all

Option Explicit

Private Sub TextBox1_KeyDown(keyCode As Integer, ByVal shift As Integer)
    keyCode = 0
End Sub
This should ignore all Inputs that are done by the Keyboard.

But if you start with F5 it doesn't work. If you code line by line through the code with F8, it work! Any Inputs that are made are ignored. Why?!?

Please have a look this matter. I really need this function.

Thank you very much,
Peter
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: There is a bug with KeyCode = 0

Post by TiKu »

Hi Peter,

The KeyDown event works the same as with the VB6 TextBox control. If you want to swallow keyboard input, you need to handle the KeyPress event and set the keyAscii parameter to 0.

Additional note: If you don't want the user to edit the text, you might want to check the ReadOnly property instead.

Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Rucksacktraeger
Lieutenant
Posts: 23
Joined: 15 Aug 2010, 08:42

Re: There is a bug with KeyCode = 0

Post by Rucksacktraeger »

Wow, wonderful!

This helped me also to find a solution for doublespin viewtopic.php?p=1155
Thank you so much! I think, today will be the first time that I donate to an Programmer!

Btw... On your website your wrote:
Visual Basic 6 isn’t dead yet.

YES!!!
I started with VB2008, but it's not easy to keep VB6 in grave!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: There is a bug with KeyCode = 0

Post by TiKu »

Hello Rucksacktraeger!

Did you donate something? I do not see anything on my Paypal account and now I wonder whether the transfer got lost (according to others this sometimes happens with Paypal) or you simply did not donate (which would be okay for me).

Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Rucksacktraeger
Lieutenant
Posts: 23
Joined: 15 Aug 2010, 08:42

Re: There is a bug with KeyCode = 0

Post by Rucksacktraeger »

Hi TiKu,

i didn't donate then. I had problems with my account. I had to verify that I am the right person and then I went on holiday. Today I have sent you something. If you do not get it, let me know.

I really appriciate your "work". It's amazing!!!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: There is a bug with KeyCode = 0

Post by TiKu »

I've received the donation. Many thanks! :)
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply