OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-05-2004, 14:09
lasergraver
Guest
 
Posts: n/a
Default sorted font list in VBA?

Howdy all,

I have populated a combobox with a list on available fonts using:

Dim I as Integer
Dim var As Variant
Dim Cnt As Integer

For I = 1 To Application.FontList.Count
Form1.ComboBox1.AddItem Application.FontList.Item(I)
Next I

The list comes in unsorted. It appears that the .sorted property is not available in VBA so am sorting this list using:

For Cnt = 0 To Form1.ComboBox1.ListCount - 2
If Form1.ComboBox1.List(Cnt) > Form1.ComboBox1.List(Cnt + 1) Then
var = Form1.ComboBox1.List(Cnt)
Form1.ComboBox1.List(Cnt) = Form1.ComboBox1.List(Cnt + 1)
Form1.ComboBox1.List(Cnt + 1) = var
Cnt = -1
End If
Next Cnt

This is very slow (54 seconds to process 540 fonts)! Is there a better way or am totaly on the wrong track?

Many Thanks....
Reply With Quote
  #2  
Old 06-05-2004, 18:16
lees
Guest
 
Posts: n/a
Default hh

use array to do so and than add the array to the listbox
Reply With Quote
  #3  
Old 11-05-2004, 05:52
d-signer
Guest
 
Posts: n/a
Default

I used Microsoft ListView Control (SP4) MSCOMCTL.OCX which comes with Visual Basic for Enterprises for sorting list of my fonts. Very quickly.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Someone make an Active List Font macro dungbtl CorelDRAW/Corel DESIGNER VBA 8 28-10-2019 09:53
Font list combobox ddonnahoe CorelDRAW/Corel DESIGNER VBA 2 17-02-2005 21:02
CD 10, VBA not returning true outline width Webster CorelDRAW/Corel DESIGNER VBA 1 24-11-2004 17:09
Draw 12 VBA Wish List Alex CorelDRAW/Corel DESIGNER VBA 43 01-04-2004 02:08
Detect if VBA is installed (an answer and a question) reanan CorelDRAW/Corel DESIGNER VBA 3 04-12-2002 14:35


All times are GMT -5. The time now is 07:17.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com