View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
-Zoki- -Zoki- is offline
external usenet poster
 
Posts: 5
Default VBA - Disable up down movement inside ListBox

Hi,

I'm using office XP.
I create a list box , inside ListBox I have some items, when I press
up arrow and down arrow key, upper or bottom item is selected and this is done
without any key-press event subroutine, it is working automatically.

Is it possible somehow to disable this behavior ?
I want to make my own key press event for up and down arrow keys which will
select item, but only in case when some other condition meet .


For example I have in ListBox 10 items, selected item is on 4th place.
When I press up arrow key , event subroutine will start.
This event subroutine will check one condition (from some other subroutine) ,
if this condition is TRUE than selection in listbox will move on 3rd place.
If condition is FALSE than nothing happens, selection stays on 4th place.

Zok