realbasic-nug
[Top] [All Lists]

Re: List selection

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: List selection
From: Youri <lystes at free dot fr>
Date: Tue, 28 Nov 2006 21:45:25 +0100
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <C191D395 dot 1A38B%seth at johnfinley dot com>



Seth,


Thanks for the bit of code, but the index (n) returned is always "0" even thought the font name is rigth.

I did put a test as

MsgBox "Font name is " + myFontName + " n = " + str(n)


But it seems that there might be a pb with my code to populate the listbox.

If I check how many times the max value of i = f.count, I get 31, but my listbox shows many more fonts (about 60).

However, when I selct any of the font between 32 and 60 the font is not recognised.

Could this be the problem in my listbox?


TIA,

Regards,

Youri



Seth Duke wrote:
On 11/28/06 11:28 AM, "Youri" <lystes at free dot fr> wrote:

I have the following code to populate a listbox :

   f=FontsFolder

   For i=1 to f.count
     self.ListBox1.addrow f.item(i).name
   Next

I would like, that once the list is populated, the line containing the
name of my default font (stored in self.Cal.propFont) to be selected in
the listbox.


For
    ...
    If f.item(i).name = myFontName then
        n = listbox.LastRow
    End if
Next

Listbox.Selected(n) = True

-Seth


_______________________________________________
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>


_______________________________________________
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>