realbasic-nug
[Top] [All Lists]

Re: listbox arrow keys not working

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: listbox arrow keys not working
From: D Jungk <rb at flippingdades dot com>
Date: Mon, 29 May 2006 20:45:00 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20060529221518 dot 53055 dot qmail at web36811 dot mail dot mud dot yahoo dot com>
On Monday 29 May 2006 5:15 pm, Long Huynh wrote:
> in the Change Event for the list box, ListBproduct.
> I make sure setfocus for the ListBproduct at the end.
>
Hi Long Huynh,
You need to put some code in the KeyDown event. It will look something like 
this:

If Asc(key)=31 then // down arrow
ListBproduct.ListIndex=ListBproduct.ListIndex+1
End if

If Asc(key)=30 then  // up arrow
ListBproduct.ListIndex=ListBproduct.ListIndex-1
End if

You'll need to deal with what happens if the down arrow is pressed while they 
are in the last row or the up arrow when they are in the first row.

You may need a "return true" at the end of the code, I don't remember for 
sure.

If you need to navegate left and right, left arrow is chr(28) and right is 
chr(29)

Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>