1. list box question
- Posted by George Walters <gwalters at sc.rr.com> Dec 24, 2004
- 582 views
How do I find the number of lines available in a list box?
2. Re: list box question
- Posted by Derek Parnell <ddparnell at bigpond.com> Dec 24, 2004
- 542 views
George Walters wrote: > > > How do I find the number of lines available in a list box? Assuming you are using win32lib, go to the documentation and look under List Control. There you will see a function called getCount(). That function returns the number of lines currently in a list box. If you are asking what is tha maximum number of lines you can enter, then I think its around 64000. To double check this go the the http://microsoft.msdn.com site and look up the list control details there. -- Derek Parnell Melbourne, Australia
3. Re: list box question
- Posted by George Walters <gwalters at sc.rr.com> Dec 24, 2004
- 519 views
It's neither Derek, I would like to know how many lines fit in the list box space presented on the screen. Is there a function to return that bit of info?.
4. Re: list box question
- Posted by Bernie Ryan <xotron at bluefrog.com> Dec 24, 2004
- 526 views
George Walters wrote: > > It's neither Derek, I would like to know how many lines fit in the list box > space presented on the screen. Is there a function to return that bit of > info?. > George: I think the only way you could do this is to determine the size of your listbox in pixels and then divide that by the height of the font to get the number of list entries showing. You would have to recalculate each time the user resizes the list control. Bernie My files in archive: w32engin.ew mixedlib.e eu_engin.e win32eru.ew Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
5. Re: list box question
- Posted by Jonas Temple <jtemple at yhti.net> Dec 24, 2004
- 546 views
George Walters wrote: > > It's neither Derek, I would like to know how many lines fit in the list box > space presented on the screen. Is there a function to return that bit of > info?. > George, Here's how I do what you're looking for: cpp = sendMessage(ResultsLV, LVM_GETCOUNTPERPAGE, 0, 0) and Bernie is right, you'll need to call this routine any time you want to work with the number of visible elements if the window can be resized. Jonas Temple http://www.yhti.net/~jktemple
6. Re: list box question
- Posted by George Walters <gwalters at sc.rr.com> Dec 25, 2004
- 558 views
Thanks for the help but that didn't work. I got "ResultsLV" not found. Must be something in 60.x and I'm using 59.1... This is what I'm using(completely imperical) that is usually close. tmp = getExtent(idList) nbrLines = int(tmp[2]/(fontHeight+1) - 1)
7. Re: list box question
- Posted by Don <eunexus at yahoo.com> Dec 26, 2004
- 523 views
George Walters wrote: > > Thanks for the help but that didn't work. I got "ResultsLV" not found. Must be > something > in 60.x and > I'm using 59.1... This is what I'm using(completely imperical) that is usually > close. > tmp = getExtent(idList) > nbrLines = int(tmp[2]/(fontHeight+1) - 1) > If you cant use that this >should< be universal... 1) get the client rectangle 2) use upper left point with sendMessage [LB_ITEMFROMPOINT] for 1st line# 3) use bottom right point with sendMessage [LB_ITEMFROMPOINT] for 2nd line# 4) subtract 1st line# from second line# and add 1 for total Sorry, would give a complete code snip or function but I dont have the time right now... :/ Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com