From: Jan Hyde on
<wintelweb(a)yahoo.it>'s wild thoughts were released on Thu,
20 Apr 2006 10:01:44 +0200 bearing the following fruit:

>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.

Why don't they use the left and right keys to um... scroll
left and right?

J


>
>
>------------------------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 :)
>>
>>
>


Jan Hyde (VB MVP)

--
A man is incomplete until he is married.
After that, he is finished.

(Zsa Zsa Gabor)

From: Rick Rothstein 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?

I'm curious... since the current, built-in action for the Up/Down Arrow keys
is not satisfactory... I'm guessing because the active cell is changed...
assuming you can find a way to make the grid scroll using the arrow keys
without changing the active cell, what is your plan to allow your user the
ability to actually move the active cell around? Will he/she **only** be
able to do that with the mouse? Or are you planning on using a different
keyboard action for this functionality?

Rick


From: Henning on
From VB6 MSDN Help

Note If the KeyPreview property is set to True, a form receives these
events before controls on the form receive the events. Use the KeyPreview
property to create global keyboard-handling routines.

Change MSHFlexGrid1_KeyUp / KeyDn to Form_KeyUp / KeyDn to catch the events.

/Henning

<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?
> >
> >
>
>


From: Steve Gerrard on

"Henning" <computer_hero(a)coldmail.com> wrote in message
news:4448e180$0$6625$57c3e1d3(a)news3.bahnhof.se...
> From VB6 MSDN Help
>
> Note If the KeyPreview property is set to True, a form receives these
> events before controls on the form receive the events. Use the KeyPreview
> property to create global keyboard-handling routines.
>
> Change MSHFlexGrid1_KeyUp / KeyDn to Form_KeyUp / KeyDn to catch the events.
>

As with the Tab key in other controls, even a Form with KeyPreview = True does
not receive the key up events for the tab or arrow keys when the grid has focus.



From: Henning on

"Steve Gerrard" <mynamehere(a)comcast.net> skrev i meddelandet
news:2cidnSg06ppNbNXZnZ2dnUVZ_tKdnZ2d(a)comcast.com...
>
> "Henning" <computer_hero(a)coldmail.com> wrote in message
> news:4448e180$0$6625$57c3e1d3(a)news3.bahnhof.se...
> > From VB6 MSDN Help
> >
> > Note If the KeyPreview property is set to True, a form receives these
> > events before controls on the form receive the events. Use the
KeyPreview
> > property to create global keyboard-handling routines.
> >
> > Change MSHFlexGrid1_KeyUp / KeyDn to Form_KeyUp / KeyDn to catch the
events.
> >
>
> As with the Tab key in other controls, even a Form with KeyPreview = True
does
> not receive the key up events for the tab or arrow keys when the grid has
focus.
>
>
hmmm, your'e right ofcause :(
Same for home, end, pageup, pagedn. But with a ListBox having focus it's ok
!?
/Henning