Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference between a functionkey and a pushbutton
Message
De
09/07/2000 17:15:25
 
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00389333
Message ID:
00390026
Vues:
14
>>On my form everything is disabled and it holds a datagrid, keypreview is true.
>>When I press a functionkey the datagrid has to be enabled, the current row has to be highlighted and when I press the down arrow key I have to scroll in the grid.
>>This code written under the functionkey doesn’t work, when I put the same code under a pushbutton it works.
>>Code:
>>With dgdgrid
>>.Enabled = True
>>.MarqueeStyle = 3
>>.SetFocus
>>End With
>>
>>Can someone please tell me why it doesn’t work under a functionkey and what the solution is?
>
>What do you mean by "functionkey"? Is it F1 and the rest? Where do you place it to it isn't working? I suppose that you have placed it in the Form_KeyDown event!
>
>Show more code!!!

Yes, you are correct I do mean F1 and the rest, and placed the code for capture in the Form_KeyDown event.
With a Case I check all keys and call Private Subs.
When F10 is pressed I call a Private Sub to delete a row in the grid. The grid is disabled. The Private sub contains the code above, the RecordSet is also opened in this sub.
The code for deleting the row is a different Private Sub, called when the "Enter" key is pressed.

When F10 is pressed, the grid in enabled, the current row is highlighted but when pressing the "Down Arrow" key the form menu (top left) scrolls down and I'm scrolling in that menu instead of in the grid.
As I mentioned before that same code under a pushbutton works.

I hope you can clear this for me, thank you.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform