PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: SeaVipe on February 15, 2022, 01:51:21 PM

Title: ListView - Keyboard
Post by: SeaVipe on February 15, 2022, 01:51:21 PM
Hi Paul,
On a ListView control, all of the alpha and numeric keyboard keys will move the selected row to the top. Other keys function as expected.
Can this behaviour be changed or disabled?
Title: Re: ListView - Keyboard
Post by: Paul Squires on February 16, 2022, 10:30:22 AM
Hi Clive, I am looking into this now. I haven't used the visual designer much in the last few months so I am reacquainting myself with the code.
Title: Re: ListView - Keyboard
Post by: Paul Squires on February 16, 2022, 10:41:10 AM
Hi Clive,

The following code show work. It allows you to filter what keypresses to allow/disallow for your Listview. Make sure to enable the "KeyDown" event for your Listview.


''
''
Function frmMainJ_lvJournal_KeyDown( ByRef sender As wfxListView, ByRef e As EventArgs ) As LRESULT
   select case e.KeyCode
      case VK_TAB, VK_UP, VK_DOWN, VK_NEXT, VK_PRIOR, VK_HOME, VK_END
         ' we allow these keys so let them pass to the framework.
      case else
         ' do not process any other keys so let the framework know
         ' that we have handled them.
         e.Handled = true   
   end select
   Function = 0
End Function

Title: Re: ListView - Keyboard
Post by: SeaVipe on February 16, 2022, 01:35:07 PM
Perfect, thanks, Paul.