From: Steve Gerrard on

"Rick Rothstein" <rickNOSPAMnews(a)NOSPAMcomcast.net> wrote in message
news:tvmdndknILknQtvZRVn-rA(a)comcast.com...
>>> It is possible to capture KeyUp event on the MsHFlexGrid?
>>
>> Private Sub MSHFlexGrid1_KeyUp(KeyCode As Integer, Shift As Integer)
>>
>> End Sub
>
> I'm pretty sure he already knows this. My suspicion is that he has a different
> but related problem that he is, for some reason, not being forthcoming about.
>

I'm pretty sure too. I thought stating the obvious might nudge him into spilling
some beans...now we all wait with baited breath :)


From: wintelweb on
Object : MSHFlexgrid

Property.
Scrollbars: 1- Horizontal

Problem.
To slide the MsHFlexGrid with the keys arrow up and arrow down.

Question.
- I must slide the MSHFlexGrid with the keys up arrow and down arrow.
- When I press the key the event comes generated: KeyDown.
- When release the key arrow does not come generated some event :KeyUp.



------------------------When I press the key : up arrow or down
arrow ----------------
Private Sub MSHFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer)

...........................................................................
......... "This code is executed" ...............
.....................................................................

Dim i As Integer
With Wintel.MSHFlexGrid1

Select Case KeyCode

Case 40:
---------- my code -------------------

Case 38:
---------- my code -------------------

End Select

End With
...........................


End
----------------------------------------------------

----------------- When release the key: up arrow or down
rrow -------------------------
Private Sub MSHFlexGrid1_KeyUp(KeyCode As Integer, Shift As Integer)

......... "This code has not been executed" ...............

Dim i As Integer
With Wintel.MSHFlexGrid1

Select Case KeyCode

Case 40:
---------- my code -------------------

Case 38:
---------- my code -------------------

End Select

End With
...........................
.....................................................................

End Sub

--------------------------------------------------------------------------------------------




"Steve Gerrard" <mynamehere(a)comcast.net> ha scritto nel messaggio
news:Rbadnc3FY_cdfdvZnZ2dnUVZ_vednZ2d(a)comcast.com...
>
> "Rick Rothstein" <rickNOSPAMnews(a)NOSPAMcomcast.net> wrote in message
> news:tvmdndknILknQtvZRVn-rA(a)comcast.com...
>>>> It is possible to capture KeyUp event on the MsHFlexGrid?
>>>
>>> Private Sub MSHFlexGrid1_KeyUp(KeyCode As Integer, Shift As Integer)
>>>
>>> End Sub
>>
>> I'm pretty sure he already knows this. My suspicion is that he has a
>> different but related problem that he is, for some reason, not being
>> forthcoming about.
>>
>
> I'm pretty sure too. I thought stating the obvious might nudge him into
> spilling some beans...now we all wait with baited breath :)
>
>


From: Steve Gerrard on

<wintelweb(a)yahoo.it> wrote in message
news:44473fe5$0$29107$5fc30a8(a)news.tiscali.it...
> Question.
> - I must slide the MSHFlexGrid with the keys up arrow and down arrow.
> - When I press the key the event comes generated: KeyDown.
> - When release the key arrow does not come generated some event :KeyUp.
>

Now we are getting somewhere.

The keydown event occurs for all keys, but the keyup event does not occur for
Tab or the four arrow keys, unless ctrl or shift is pressed.

I believe this is because the grid does its own navigation for these five keys,
moving the focus to a different cell. This "sinking" of the key event is seen
with the Tab key in other controls.

I don't have a quick answer for you, you might have to resort to a keyboard hook
or something to get the key up on an arrow key. Are you sure the built in
navigation of the grid is no help, or can you use ctrl-arrow instead?


From: wintelweb on
Ok. Thanks for the answer.

Unfortunately the customer uses the arrows in order to slide.

Perhaps I could put a timer in order to manage the KeyUp? Is good idea?

"Steve Gerrard" <mynamehere(a)comcast.net> ha scritto nel messaggio
news:a4WdnU1O4-byodXZ4p2dnA(a)comcast.com...
>
> <wintelweb(a)yahoo.it> wrote in message
> news:44473fe5$0$29107$5fc30a8(a)news.tiscali.it...
>> Question.
>> - I must slide the MSHFlexGrid with the keys up arrow and down arrow.
>> - When I press the key the event comes generated: KeyDown.
>> - When release the key arrow does not come generated some event :KeyUp.
>>
>
> Now we are getting somewhere.
>
> The keydown event occurs for all keys, but the keyup event does not occur
> for Tab or the four arrow keys, unless ctrl or shift is pressed.
>
> I believe this is because the grid does its own navigation for these five
> keys, moving the focus to a different cell. This "sinking" of the key
> event is seen with the Tab key in other controls.
>
> I don't have a quick answer for you, you might have to resort to a
> keyboard hook or something to get the key up on an arrow key. Are you sure
> the built in navigation of the grid is no help, or can you use ctrl-arrow
> instead?
>
>


From: Henning on

<wintelweb(a)yahoo.it> skrev i meddelandet
news:4448b464$0$29097$5fc30a8(a)news.tiscali.it...
> Ok. Thanks for the answer.
>
> Unfortunately the customer uses the arrows in order to slide.
>
> Perhaps I could put a timer in order to manage the KeyUp? Is good idea?
>
> "Steve Gerrard" <mynamehere(a)comcast.net> ha scritto nel messaggio
> news:a4WdnU1O4-byodXZ4p2dnA(a)comcast.com...
> >
> > <wintelweb(a)yahoo.it> wrote in message
> > news:44473fe5$0$29107$5fc30a8(a)news.tiscali.it...
> >> Question.
> >> - I must slide the MSHFlexGrid with the keys up arrow and down arrow.
> >> - When I press the key the event comes generated: KeyDown.
> >> - When release the key arrow does not come generated some event :KeyUp.
> >>
> >
> > Now we are getting somewhere.
> >
> > The keydown event occurs for all keys, but the keyup event does not
occur
> > for Tab or the four arrow keys, unless ctrl or shift is pressed.
> >
> > I believe this is because the grid does its own navigation for these
five
> > keys, moving the focus to a different cell. This "sinking" of the key
> > event is seen with the Tab key in other controls.
> >
> > I don't have a quick answer for you, you might have to resort to a
> > keyboard hook or something to get the key up on an arrow key. Are you
sure
> > the built in navigation of the grid is no help, or can you use
ctrl-arrow
> > instead?
> >
> >
>

Isn't it possible with the KeyPreview = true, to catch the KeyUp in the
form? Then depending on what control has focus do what you need.

/Henning