How do i sort fonts in combobox? |
Post Reply |
Author | |
Nung_Gum
Newbie Joined: 09 June 2004 Location: Korea, South Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 09 June 2004 at 7:43pm |
Dim FormatBar As CommandBar
Dim intLoopCount As Integer Set FormatBar = CommandBars.Add("Format", xtpBarTop) With FormatBar.Controls Set Control = .Add(xtpControlComboBox, ID_COMBO_FONT, "Font") Control.Width = 140 Control.DropDownListStyle = True For intLoopCount = 1 To Screen.FontCount Control.AddItem Screen.Fonts(intLoopCount) Next intLoopCount End with 'not sort combobox 'How do I ? |
|
Nung_Gum
Newbie Joined: 09 June 2004 Location: Korea, South Status: Offline Points: 2 |
Post Options
Thanks(0)
|
'module bas
Public Sub QSStrings(sArray() As String, l As Integer, r As Integer) Dim i As Integer Dim j As Integer Dim x As String Dim y As String i = l j = r x = sArray((l + r) / 2) While (i <= j) While (sArray(i) < x And i < r) i = i + 1 Wend While (x < sArray(j) And j > l) j = j - 1 Wend If (i <= j) Then y = sArray(i) sArray(i) = sArray(j) sArray(j) = y i = i + 1 j = j - 1 End If Wend If (l < j) Then QSStrings sArray(), l, j If (i < r) Then QSStrings sArray(), i, r End Sub 'form load() Dim FormatBar As CommandBar Dim ControlColorPopup As CommandBarPopup Dim intLoopCount As Integer ReDim fontArray(1 To Screen.FontCount) As String Set FormatBar = CommandBars.Add("Format", xtpBarTop) With FormatBar.Controls Set Control = .Add(xtpControlComboBox, ID_COMBO_FONT, "Font") Control.Width = 140 Control.DropDownListStyle = True For intLoopCount = 1 To Screen.FontCount fontArray(intLoopCount) = Screen.Fonts(intLoopCount) Next intLoopCount QSStrings fontArray(), LBound(fontArray), UBound(fontArray) For i = LBound(fontArray) To UBound(fontArray) Control.AddItem fontArray(i), i - 1 Next |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |