|
-
Dec 12th, 2000, 10:42 AM
#1
Thread Starter
Addicted Member
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!
-
Dec 12th, 2000, 11:32 AM
#2
Why not just add it to a standard ComboBox, sort them, then add them to the ImageCombo?
-
Dec 12th, 2000, 12:59 PM
#3
Thread Starter
Addicted Member
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!
-
Dec 10th, 2001, 11:52 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|