View previous topic :: View next topic |
Author |
Message |
Hortalonus Valued Contributor
Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Mon Oct 27, 2003 6:37 pm Post subject: API to scroll list without selecting new items? |
|
|
I have a program that adds items to a visible list at a regular interval and I have set it to select the last item if the list item count exceeds a certain number. This effectively scrolls the list as new items are added. I am curious if there is a way to accomplish the same thing without selecting the last item in the list using API or a Windows message.
Here is the code I'm using... Code: | %i = @COUNT(LIST1)
IF @GREATER(%i,10)
LIST SEEK,LIST1,@PRED(%i)
END |
_________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Mon Oct 27, 2003 6:59 pm Post subject: |
|
|
LB_GETCOUNT
wParam = 0; // not used; must be zero
lParam = 0; // not used; must be zero
AND
LB_INSERTSTRING
wParam = (WPARAM) index; // item index
lParam = (LPARAM) (LPCTSTR) lpsz; // address of string to insert
An application sends an LB_INSERTSTRING message to insert a string into a list box. Unlike the LB_ADDSTRING message, the LB_INSERTSTRING message does not cause a list with the LBS_SORT style to be sorted.
Use LB_GETCOUNT to get the number of items (or even VDS)
now U know the last item.
Use LB_INSERTSTRING to add the contents at the last position.
Ofcourse this may move your selected item up as the list grows.
U can get good examples with constant values for both from PGWARE's VDS API Reference. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Mon Oct 27, 2003 7:04 pm Post subject: |
|
|
OK I think I have mistaken
You want scroll without select ?
LB_SETTOPINDEX
Code: | %i = @COUNT(LIST1)
IF @GREATER(%i,10)
%A = @SENDMSG(@WINEXISTS(~LIST1),$197,@PRED(%i),0)
END |
_________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
Hortalonus Valued Contributor
Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Mon Oct 27, 2003 8:07 pm Post subject: |
|
|
THAT is what I was looking for! Thank you CodeScript! _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
Back to top |
|
|
|