Showing results for 
Search instead for 
Did you mean: 

KeyDown validation slows the application

Former Member
0 Kudos


While checking for the KeyDown event validation, it slows down the application and User can not type in the characters smoothly. I can't even user event filter as the keydown event has to be caught for some validation on all the forms of User tables. is there any work around?

thanks and regards,


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Binita,

is the KeyDown-Event itself (without your validations) the reason for slowing the appl. or is your validation-code the reason?

I have no problems when using the key-down- event for an "automatic-capital-letter"-function in a MTX-column (for example):

                    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN Then
                        If pVal.BeforeAction And pVal.ColUID = "2" Then
                            If pVal.CharPressed >= 97 And pVal.CharPressed <= 122 Then
                                '=> 65 - 90
                                SboCon.SboUI.SendKeys(Chr(pVal.CharPressed - 32))
                                BubbleEvent = False
                            End If
                        End If
                    End If

Did you completly deactivate your event-filters for all events?

I always use event-filters. When a particular event is needed on all AddOn-forms then I add all the forms to this particular event-filter.

If the validation code is the reason for slowing down I agree with Geetha Sriram. I would also use LostFocus- or Validate-event to check the whole string.

(Validate is also fired when the user has typed a value without leaving the field and presses Add/Update - calculations in a MTX-row can be done here before Add/Update happens.

So long,


Former Member
0 Kudos

Hi Roland,

Explanation is never too long

1) I am using KeyDown for my 8 user table forms accessible through Tools -- User Tables . and since there is no certain unique form id or menu id for identifying these forms, I have to depend on the title of the forms to catch an event on these forms. (again a question worthy being asked here) , so one check is added.

2) user should not change/delete the fields once added and these are UDFs in these forms so I have to catch a Keydown of Chrpress "8" seperately for them,

3) user should be able to change the values yet not added so again have to check that.

4) user is never allowed to press a key on code column (its value always comes through addon) so again a keydown is needed to be caught.

I am putting all these checks for KeyDown event. there are no event filters as of now. now suggest if there is still some workaround to avoid catching this event.

I have tried doing entries by 1) turning this addon Off 2) commenting the keydown validation and it works smoothly like never before.

now this is long..



Edited by: Binita Joshi on Nov 19, 2008 3:24 PM

Active Contributor
0 Kudos

Hi Binita,

well, it would be interesting how your code looks like.

iam sure there's a way to optimize your code. we now know what you're doing,

but we don't see how the KEY_DOWN code looks like.

i've never had KEY_DOWN problems except when the code made big selects or something else

(things that take time). maybe your code creates innerevents ?

lg David

Former Member
0 Kudos


Can you use the LostFocus event of edit boxes?

Rather than capturing letter by letter, you can capture the whole text in the edit box, and validate it against your rules.