Results 1 to 6 of 6

Thread: *** RESOLVED *** How to sort a Listbox/Combobox?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    *** RESOLVED *** How to sort a Listbox/Combobox?

    Hi,

    ... I checked all threads for "sort Listbox" before i posted this here.


    I need to sort the data in a Listbox.

    BUT .... the data are not from a database.

    How to do it in a simple way?

    (Please don't tell me ListBox1.Sorted = True ... it doesn't work, I tried it. It is a readonly parameter at runtime and when I set it to true in the parameterbox of the Listbox then it is still not sorted.)

    Nice greetings
    Franky
    Last edited by Franky; Dec 31st, 2002 at 02:44 AM.

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Originally posted by Franky
    Hi,

    ... I checked all threads for "sort Listbox" before i posted this here.


    I need to sort the data in a Listbox.

    BUT .... the data are not from a database.

    How to do it in a simple way?

    (Please don't tell me ListBox1.Sorted = True ... it doesn't work, I tried it. It is a readonly parameter at runtime and when I set it to true in the parameterbox of the Listbox then it is still not sorted.)

    Nice greetings
    Franky
    Are the values strings or numbers? Also the Sorted property DOES work, however if you are displaying numbers, you may get results such as :

    1
    10
    11
    2
    23
    24
    5

    instead of

    1
    2
    5
    10
    11
    23
    24

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi honeybee

    First i have to say that I had a good laugh about this:

    I am not a complete idiot. Some parts are still missing

    ... it is really funny!!!


    Ok, to your .Sorted = true

    If it works it would be nice. Tell me please EXACTLY where to set it?

    nice greetings
    Franky

  4. #4
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    Its an option in the properties window
    NXSupport - Your one-stop source for computer help

  5. #5
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    In design time, right click on ListBox select 'Properties. Set 'Sorted' property to 'true'

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi

    This was the first what I did before I posted this thread here.

    Click in the properties Sorted = True

    No sorting ..... sniff

    ----------------------------

    And now I found it, hehe.

    It works. I just didn't see that the former programmer of this here used instead of .AddItem .List to fill the data

    Thanks

    Franky

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width