gettingstarted
[Top] [All Lists]

Re: Selecting the next row in a listbox

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Selecting the next row in a listbox
From: Michael Poidinger <mpoiding at medau dot jnj dot com>
Date: Tue, 30 Nov 2004 14:34:26 +1100
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <20041129231129 dot 21B52594E4A at lists dot realsoftware dot com> <20041130030835 dot 11888 dot qmail at web53003 dot mail dot yahoo dot com> <3396e7e204112919203cc9a4c4 at mail dot gmail dot com>

On 30/11/2004, at 2:20 PM, Will Leshner wrote:

On Mon, 29 Nov 2004 19:08:35 -0800 (PST), Jonathan Schraffenberger
<jonschraffenberger at yahoo dot com> wrote:
Hi Mike. Thanks for the reply. I still have a small
problem. The suggestion you made only works if I know
which row is going to be deleted at any given time.
But I won't. Is there a way of telling which row is
currently selected?


ListBox.ListIIndex is the currently selected row. It is both a setter
and a getter.


Deleting a row shifts the rows below up, so something like

currentRow = LB.listIndex
LB.removeRow(currentRow)
if LB.listCount > 0 then
        LB.selected(currentRow) = true

                        OR

        LB.listIndex = currentRow
end if

Would probably work. The If statement is to avoid an error if you delete the last row in the box.

Mike



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

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

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