Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to identify ListBox item index having focus rectangle

3 posts in Objects Last posting was on 2003-02-19 08:52:27.0Z
pkolmus Posted on 2003-02-13 04:15:52.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: pkolmus
Date: Wed, 12 Feb 2003 23:15:52 -0500
Subject: How to identify ListBox item index having focus rectangle
Lines: 5
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_60B4E2690FF437C000176CB585256CCC.00176D1485256CCC@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:116
Article PK: 712689

Is there a way in a listbox with multiselect to identify the item with the
focus rectangle? The user is using arrow keys to move among the rows and I
need to identify which row he is on.

Thanks for any methods for this.


Luca Marcato Posted on 2003-02-13 07:57:27.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Luca Marcato" <luca_marcato@hotmail.com>
Subject: Re: How to identify ListBox item index having focus rectangle
Date: Thu, 13 Feb 2003 08:57:27 +0100
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: host114-87.pool62110.interbusiness.it 62.110.87.114
Message-ID: <364_LA6gihz0CHA.198@forums.sybase.com>
References: <364_60B4E2690FF437C000176CB585256CCC.00176D1485256CCC@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:114
Article PK: 712690

long ll_ind

ll_ind = yourlistcontrolname.SelectedIndex ( )
Hth

<pkolmus> wrote in message
news:60B4E2690FF437C000176CB585256CCC.00176D1485256CCC@webforums...
> Is there a way in a listbox with multiselect to identify the item with the
> focus rectangle? The user is using arrow keys to move among the rows and
I
> need to identify which row he is on.
>
> Thanks for any methods for this.


Alexander Isaev Posted on 2003-02-19 08:52:27.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Alexander Isaev" <isaev@scil.ru>
Subject: Re: How to identify ListBox item index having focus rectangle
Date: Wed, 19 Feb 2003 11:52:27 +0300
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 195.209.149.22
Message-ID: <364_LuMrCc$1CHA.198@forums.sybase.com>
References: <364_60B4E2690FF437C000176CB585256CCC.00176D1485256CCC@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:177
Article PK: 712749

Hi! Method suggested by Luca Marcato is wrong.
It gets the index of first selected item but not index of item that has
focus.

Use this code:

constant uint LB_GETCARETINDEX = 415
int li_Index

// lb_1 is your listbox
li_Index = Send(Handle(lb_1), LB_GETCARETINDEX, 0, 0) +1

Regards, Alexander.