Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Fill a ListBox with System Fonts

Posted on 1998-11-05
9
Medium Priority
?
266 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
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
Independent Software Vendors: 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 160 total points
ID: 1443286

Check the sample I sent you in your email.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

782 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