Results 1 to 4 of 4

Thread: Sort ImageCombo Box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Orlando, FL
    Posts
    253
    I am placing the font list into the ImageCombo
    Box control. I found that the standard ComboBox
    did not have enough flexibility as the ImageCombo
    Box control. Anyways, I want to know if there is a way
    to sort the items alphabeticaly in the ImageCombo Box
    control.
    Code:
    'Initialize variables
    Dim strFont As String
    Dim intFont As Integer
    
    'Populates cboFont with the system fonts
    For intFont = 1 To Screen.FontCount - 1
        'Stores the font into a variable for faster retrieval instead of
        'referencing Screen.Fonts several times.
        strFont = Screen.Fonts(intFont)
        imgcboFonts.ComboItems.Add , strFont, strFont
    Next
    Does anyone have any idea? There is no sorting property
    for this control so there might be a way to do this from
    the Windows API.
    Always looking for a better and faster way!

  2. #2
    Guest
    Why not just add it to a standard ComboBox, sort them, then add them to the ImageCombo?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Orlando, FL
    Posts
    253
    I would add them to a Combo Box, but I need to access the
    font by the font name. I am storing the font name into a
    database. When I want to select the font in the Combo Box,
    I can only access an item by its Index.

    With an ImageCombo Box, I can use the Key property and
    access the font name throught the Key.

    I cant find out how to sort the ImageCombo though.
    Always looking for a better and faster way!

  4. #4
    WALDO
    Guest

    Cool What I tend to do...

    Insert into a ComboBox, the Name of the font, then concatenate it with some delimiter, then contcatenate the key tou want to put in there.Then another delimiter and the index of the image you want to use. Then, as the combobox is sorted, I break apart each item in the list and apply it to the ImageCombo.

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