Solved

Fill a ListBox with System Fonts

Posted on 1998-11-05
9
261 Views
Last Modified: 2013-12-02

How do you fill a ListBox (List1) with the TrueTypes
Fonts on the system?

I do NOT want to see a preview, but rather their names
AND the True Type image on my left.

I have the Image.

Thank you.
0
Comment
Question by:vienna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 1

Expert Comment

by:zivf
ID: 1443278
I usually don't write answer as code, but this one was far too much.
Go and read the visual basic documentation, you might find some interesting stuff there.
here is the code,

Dim i As Integer
For i = 0 To Screen.FontCount - 1
    Me.Combo1.AddItem Screen.Fonts(i)
Next i

0
 

Author Comment

by:vienna
ID: 1443279

zivf,
you hardly even read my question.
1st you wrote it for a comboBox, not that I care because it will work as well,
but you missed out on the most important part of my question.
Adding an image for each font. I can use my own. 16 x 16


0
 
LVL 12

Expert Comment

by:mark2150
ID: 1443280
I can do it in a rich text box, but not (easily) in a list box. If that works let me know & I'll post code.

M

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mark2150
ID: 1443281
Here is example using RTB. Set up form with a List and a RichTextBox

maxfonts = Screen.FontCount - 1
List1.Clear
For i = 0 To maxfonts
       List1.AddItem Screen.Fonts(i)
Next i
RTB1.Text = ""
RTB1.TextRTF = ""
For i = 0 To maxfonts
        work = List1.List(i)
        RTB1.SelFontName = work
        RTB1.SelText = work & vbCrLf
Next i

0
 

Author Comment

by:vienna
ID: 1443282

Is everyone missing out on my question?
The image, how do you NOT only get the system fonts
but insert an image from an image list!
In a listbox, can it be done?
0
 
LVL 1

Expert Comment

by:csalves
ID: 1443283
Hello,
You can't do it in a normal ListBox, try another OCX from Crescent OR Apex.

Regards
0
 
LVL 15

Expert Comment

by:ameba
ID: 1443284
or use ListView control
0
 
LVL 7

Expert Comment

by:kamall
ID: 1443285
vienna,
As csalves said, you can not incorporate images in a list box control. You can use the ListView control as ameba suggested.
If you need code, leave me a comment.
Regards
0
 
LVL 4

Accepted Solution

by:
idcanada earned 40 total points
ID: 1443286

Check the sample I sent you in your email.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question