Installierte Schriftarten in Kombinationsfeld laden (Access 2003)

  • Access

Es gibt 18 Antworten in diesem Thema. Der letzte Beitrag () ist von vba_newsbie.

    Installierte Schriftarten in Kombinationsfeld laden (Access 2003)

    so habe ich es versucht:

    Quellcode

    1. Option Compare Database
    2. Option Explicit
    3. Declare Function wlib_GetDC Lib "user32" Alias "GetDC" (ByVal hWnd As Long) As Long
    4. Declare Function wlib_GetFontCount Lib "msaccess.exe" Alias "#61" (ByVal hdc As Long) As Long
    5. Declare Function wlib_GetFontList Lib "msaccess.exe" Alias "#62" (ByVal hdc As Long, fiFonts() As wlib_FONTINFO) As Long
    6. Declare Function wlib_ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hWnd As Long, ByVal hdc As Long) As Long
    7. Declare Function wlib_GetSizeCount Lib "msaccess.exe" Alias "#63" (ByVal hdc As Long, ByVal szFont As String) As Long
    8. Declare Function wlib_GetSizeList Lib "msaccess.exe" Alias "#64" (ByVal hdc As Long, ByVal szFont As String, lSizeList() As Long) As Long
    9. Declare Sub wlib_AccChooseColor Lib "msaccess.exe" Alias "#53" (ByVal hWnd As Long, rgb As Long)
    10. Declare Function wlib_FTwipsFromFont Lib "msaccess.exe" Alias "#67" (ByVal stFontName As String, ByVal iSize As Long, ByVal iWeight As Long, ByVal fItalic As Long, ByVal fUnderline As Long, ByVal cch As Long, ByVal stCaption As String, ByVal cchUseMaxWidth As Long, dx As Long, dy As Long) As Integer
    11. Declare Function wlib_GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hdc As Long, ByVal nIndex As Long) As Long
    12. Declare Function wlib_GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
    13. Dim rgfiFonts() As wlib_FONTINFO
    14. Global wlib_rgaii() As WLIB_ADDININFO
    15. Global mlbl_mlbi As MLBL_INFO
    16. Global wlib_caii As Integer
    17. Type WLIB_POINT
    18. x As Long
    19. Y As Long
    20. End Type
    21. Type MLBL_INFO
    22. StRptName As String
    23. fBrowse As Integer
    24. iLabelId As Integer
    25. fUserSizes As Integer
    26. fMetric As Integer
    27. fDotMatrix As Integer
    28. fPortrait As Integer
    29. cItemsAcross As Integer
    30. stFontName As String
    31. iFontSize As Integer
    32. iFontWeight As Integer
    33. lFontColor As Long
    34. fItalic As Integer
    35. fUnderline As Integer
    36. dytextbox As Integer
    37. dxGrid As Integer
    38. dyGrid As Integer
    39. fUsrPrefsChng As Integer
    40. fOpenGroupBox As Integer
    41. ptLabelSize As WLIB_POINT
    42. dxdySpace As WLIB_POINT
    43. xLeftMargin As Integer
    44. xRightMargin As Integer
    45. yTopMargin As Integer
    46. ptOrigin As WLIB_POINT
    47. End Type
    48. Type STYL_CONTROLSIZINGINFO
    49. stFontName As String
    50. iFontSize As Integer
    51. iFontWeight As Integer
    52. fFontItalic As Integer
    53. fFontUnderline As Integer
    54. stCaption As String
    55. cch As Integer
    56. iBorderStyle As Integer
    57. iBorderWidth As Integer
    58. iSpecialEffect As Integer
    59. cchUseMaxWidth As Integer
    60. dxLine As Long
    61. dyLine As Long
    62. dxBorder As Long
    63. dyBorder As Long
    64. End Type
    65. Type WLIB_ADDININFO
    66. stName As String
    67. rsStrings As Recordset
    68. stStringsField As String
    69. End Type
    70. Type wlib_FONTINFO
    71. fRasterFont As Long
    72. rgstName As String * 32
    73. End Type
    74. Global styl_xPixelPerInch As Integer
    75. Global styl_yPixelPerInch As Integer
    76. Global styl_xTwipsPerPixel As Integer
    77. Global styl_yTwipsPerPixel As Integer
    78. Sub wlib_SmartCtlPropSet(ByRef ctl As Control, stProp As String, vVal As Variant)
    79. ' Setze im Control (z.B. Feld) "Ctl" das Property "stProp" auf den Wert "vVal"
    80. ' z.B: Setze im Feld "Me!bxcolor" das Property "Backcolor" auf den entsprechenden Wert
    81. If (ctl.Properties(stProp) <> vVal) Then ctl.Properties(stProp) = vVal
    82. End Sub
    83. Function wlib_StFromSz(szTmp As String) As String
    84. Dim ich As Integer
    85. ich = InStr(1, szTmp, vbNullChar, vbBinaryCompare)
    86. If ich Then
    87. wlib_StFromSz = Left$(szTmp, ich - 1)
    88. Else
    89. wlib_StFromSz = szTmp
    90. End If
    91. End Function
    92. Function wlib_StFromAccessIds(ID As Long) As String
    93. On Error GoTo wlib_StFromAccessIds_Err
    94. wlib_StFromAccessIds = Application.AppLoadString(ID)
    95. wlib_StFromAccessIds_Exit:
    96. Exit Function
    97. wlib_StFromAccessIds_Err:
    98. wlib_StFromAccessIds = ""
    99. Resume wlib_StFromAccessIds_Exit
    100. End Function
    101. Public Function SchriftBestimmen(Optional I As Integer = 1) As String
    102. On Error GoTo Err_Click
    103. 'Dim FeldBEZ
    104. 'FeldBEZ = "VBFT" & CStr(I)
    105. 'If Not Nz(dlookup(FeldBEZ, "VB-Firma"), "") = "" Then
    106. ' SchriftBestimmen = dlookup(FeldBEZ, "VB-Firma")
    107. 'Else
    108. SchriftBestimmen = "Arial,10,Falsch,Falsch"
    109. 'End If
    110. Exit_Click:
    111. Exit Function
    112. Err_Click:
    113. msgbox Err.Description
    114. Resume Exit_Click
    115. End Function
    116. Public Function SchriftZuweisen()
    117. Dim Steuerelement As Control
    118. On Error GoTo Err_Click
    119. Dim Schriftart As String, Schriftgr, Schriftfett, Schriftkursiv
    120. Dim SchriftInfo As String
    121. Dim I%, i1%, i2%, i3%, Zaehler%, z$
    122. msgbox "TEst"
    123. SchriftInfo = SchriftBestimmen(1)
    124. For I = 1 To Len(SchriftInfo)
    125. z = Mid$(SchriftInfo, I, 1)
    126. If z = "," Then
    127. Zaehler = Zaehler + 1
    128. If Zaehler = 1 Then
    129. i1 = I
    130. End If
    131. If Zaehler = 2 Then
    132. i2 = I
    133. End If
    134. If Zaehler = 3 Then
    135. i3 = I
    136. End If
    137. End If
    138. Next I
    139. Schriftkursiv = Mid$(SchriftInfo, i3 + 1, Len(SchriftInfo))
    140. Schriftfett = Mid$(SchriftInfo, i2 + 1, i3 - i2 - 1)
    141. Schriftgr = Mid$(SchriftInfo, i1 + 1, i2 - i1 - 1)
    142. Schriftart = Mid$(SchriftInfo, 1, i1 - 1)
    143. With Steuerelement
    144. .FontName = Schriftart
    145. .FontSize = Schriftgr
    146. .FontBold = Schriftfett
    147. .FontItalic = Schriftkursiv
    148. End With
    149. Exit_Click:
    150. Exit Function
    151. Err_Click:
    152. msgbox Err.Description
    153. Resume Exit_Click
    154. End Function
    155. Public Function Schriftart1() As String
    156. Schriftart1 = SchriftAnalyse(1, "Art")
    157. End Function
    158. Public Function Schriftart2() As String
    159. Schriftart2 = SchriftAnalyse(2, "Art")
    160. End Function
    161. Public Function Schriftart3() As String
    162. Schriftart3 = SchriftAnalyse(3, "Art")
    163. End Function
    164. Public Function Schriftkursiv1() As Boolean
    165. Schriftkursiv1 = SchriftAnalyse(1, "kursiv")
    166. End Function
    167. Public Function Schriftkursiv2() As Boolean
    168. Schriftkursiv2 = SchriftAnalyse(2, "kursiv")
    169. End Function
    170. Public Function Schriftkursiv3() As Boolean
    171. Schriftkursiv3 = SchriftAnalyse(3, "kursiv")
    172. End Function
    173. Public Function Schriftfett1() As Boolean
    174. Schriftfett1 = SchriftAnalyse(1, "fett")
    175. End Function
    176. Public Function Schriftfett2() As Boolean
    177. Schriftfett2 = SchriftAnalyse(2, "fett")
    178. End Function
    179. Public Function Schriftfett3() As Boolean
    180. Schriftfett3 = SchriftAnalyse(3, "fett")
    181. End Function
    182. Public Function SchriftGroesse1() As Integer
    183. SchriftGroesse1 = SchriftAnalyse(1, "Größe")
    184. End Function
    185. Public Function SchriftGroesse2() As Integer
    186. SchriftGroesse2 = SchriftAnalyse(2, "Größe")
    187. End Function
    188. Public Function SchriftGroesse3() As Integer
    189. SchriftGroesse3 = SchriftAnalyse(3, "Größe")
    190. End Function
    191. Public Function SchriftAnalyse(SchriftNr As Integer, Info As String)
    192. 'Dim Schriftart As String, Schriftgr As Integer, Schriftfett As Boolean, Schriftkursiv As Boolean
    193. On Error GoTo Fehler
    194. Dim SchriftInfo As String
    195. Dim I%, i1%, i2%, i3%, Zaehler%, z$
    196. SchriftInfo = SchriftBestimmen(SchriftNr)
    197. For I = 1 To Len(SchriftInfo)
    198. z = Mid$(SchriftInfo, I, 1)
    199. If z = "," Then
    200. Zaehler = Zaehler + 1
    201. If Zaehler = 1 Then
    202. i1 = I
    203. End If
    204. If Zaehler = 2 Then
    205. i2 = I
    206. End If
    207. If Zaehler = 3 Then
    208. i3 = I
    209. End If
    210. End If
    211. Next I
    212. Select Case Info
    213. Case "kursiv"
    214. SchriftAnalyse = Mid$(SchriftInfo, i3 + 1, Len(SchriftInfo))
    215. Case "fett"
    216. SchriftAnalyse = Mid$(SchriftInfo, i2 + 1, i3 - i2 - 1)
    217. Case "Größe"
    218. SchriftAnalyse = Mid$(SchriftInfo, i1 + 1, i2 - i1 - 1)
    219. Case "Art"
    220. SchriftAnalyse = Mid$(SchriftInfo, 1, i1 - 1)
    221. End Select
    222. fehler2:
    223. Exit Function
    224. Fehler:
    225. msgbox Err.Description
    226. End Function


    es treten folgende Fehler auf:

    unzulässige Verwendung von NULL in form_open
    InitFontList: DLL-Einsprungpunkt 61 in msaccess.exe
    Objectvariable oder with-Blockvariable nicht festgelegt

    Weiß mir keinen Rat mehr. Bin für jede Hilfe dankbar. Danke im Vorraus
    InitFontList: DLL-Einsprungpunkt 61 in msaccess.exe wird folgender Zeile geworfen:

    Declare Function wlib_GetFontCount Lib "msaccess.exe" Alias "#61" (ByVal hdc As Long) As Long

    Dieser Code lief in Access 97 wunderbar aber nun in Access2003 nicht mehr, bei gleichem BS.

    Gruss
    Mit folgender Sub realisiere ich das in .NET:

    Quellcode

    1. Private Sub RTFBOX_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2. Dim myFonts As New InstalledFontCollection
    3. For Each oFont As FontFamily In myFonts.Families
    4. Debug.Print(oFont.Name)
    5. ' Listbox mit einer Auswahl an Schriftart füllen
    6. ListBox3.Items.Add(oFont.Name)
    7. ' Vorauswahl in der Listbox
    8. ListBox3.SelectedIndex = 0
    9. Next
    10. ' Listbox mit einer Auswahl an Schriftgrößen füllen
    11. For Each no As Integer In Enumerable.Range(8, 17)
    12. ListBox4.Items.Add(no)
    13. Next
    14. ' Vorauswahl in der Listbox
    15. ListBox4.SelectedIndex = ListBox4.Items.IndexOf(10)
    16. 'Lineal einblenden
    17. End Sub


    Die Frage ist halt wie schreibe ich das so um, das es in Access 2003 funktioniert.
    okay, du nennst dich new(s)bie, verwendest aber api... okay, ich nehm's mal zur kenntnis

    Ich habe keinen Plan, könnte mir aber vorstellen, dass die entsprechende API von A97 zu A2003 geändert hat. Vielleicht hat die API-Funktion ja plötzlich mehr Argumente oder andere Typen? Woher Du die schlauen DECLAREs hast, weiss ich nicht, aber vielleicht suchst Du dort weiter...

    Und nach etwas googlen ist mir nun klar, dass die APIs die du verwendest erstens NICHT DOKUMENTIERT sind, d.h. jederzeit von Version zu Version ändern können und zweitens, dass die offensichtlich schon früh, also unter A97 durch jemanden mit viel Geduld per try and error ausprobiert und quasi-dokumentiert wurden. Ergo: Kein Grund für Access 2003 das zu tun, was du gerne möchtest....

    Vielleicht hilft Dir aber dieser Link hier weiter. Ist zwar eine recht umständliche Lösung, aber immerhin:

    exceltip.com/st/Display_all_in…_Microsoft_Excel/511.html

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „harryhirsch“ ()

    harryhirsch schrieb:

    okay, du nennst dich new(s)bie, verwendest aber api... okay, ich nehm's mal zur kenntnis

    Ich habe keinen Plan, könnte mir aber vorstellen, dass die entsprechende API von A97 zu A2003 geändert hat. Vielleicht hat die API-Funktion ja plötzlich mehr Argumente oder andere Typen? Woher Du die schlauen DECLAREs hast, weiss ich nicht, aber vielleicht suchst Du dort weiter...

    Und nach etwas googlen ist mir nun klar, dass die APIs die du verwendest erstens NICHT DOKUMENTIERT sind, d.h. jederzeit von Version zu Version ändern können und zweitens, dass die offensichtlich schon früh, also unter A97 durch jemanden mit viel Geduld per try and error ausprobiert und quasi-dokumentiert wurden. Ergo: Kein Grund für Access 2003 das zu tun, was du gerne möchtest....

    Vielleicht hilft Dir aber dieser Link hier weiter. Ist zwar eine recht umständliche Lösung, aber immerhin:

    http://www.exceltip.com/st/Display_all_installed_fonts_(Word)_using_VBA_in_Microsoft_Excel/511.html
    also so richtig weiß ich nicht was ich zu Deinem Post schreiben soll. Auf jedenfall Danke für den Link!
    Nun, ich bin ja nicht gerade der Profi, wenn's um Fonts geht, aber ist es nicht so, dass True Type Schriften frei skalierbar sind, da Vektorgrafiken? Damit wären ja theoretisch alle Grössen "verfügbar". Kann es sein, dass Du aufgrund der Drop-Down-Listen in Word o.ä. davon ausgehst, dass es nur bestimmte Grössen gibt?

    Und vielleicht könntest Du ja noch die einfache Lösung posten, die Du gefunden hast...
    Hallo harryhirsch,

    ja poste mal eben die Lösung für das befüllen einer ComboBox mit den Installierten Schriftarten.

    Visual Basic-Quellcode

    1. Option Compare Database
    2. Option Explicit
    3. Public Const NTM_REGULAR = &H40&
    4. Public Const NTM_BOLD = &H20&
    5. Public Const NTM_ITALIC = &H1&
    6. Public Const TMPF_FIXED_PITCH = &H1
    7. Public Const TMPF_VECTOR = &H2
    8. Public Const TMPF_DEVICE = &H8
    9. Public Const TMPF_TRUETYPE = &H4
    10. Public Const ELF_VERSION = 0
    11. Public Const ELF_CULTURE_LATIN = 0
    12. Public Const RASTER_FONTTYPE = &H1
    13. Public Const DEVICE_FONTTYPE = &H2
    14. Public Const TRUETYPE_FONTTYPE = &H4
    15. Public Const LF_FACESIZE = 32
    16. Public Const LF_FULLFACESIZE = 64
    17. Type LOGFONT
    18. lfHeight As Long
    19. lfWidth As Long
    20. lfEscapement As Long
    21. lfOrientation As Long
    22. lfWeight As Long
    23. lfItalic As Byte
    24. lfUnderline As Byte
    25. lfStrikeOut As Byte
    26. lfCharSet As Byte
    27. lfOutPrecision As Byte
    28. lfClipPrecision As Byte
    29. lfQuality As Byte
    30. lfPitchAndFamily As Byte
    31. lfFaceName(LF_FACESIZE) As Byte
    32. End Type
    33. Type NEWTEXTMETRIC
    34. tmHeight As Long
    35. tmAscent As Long
    36. tmDescent As Long
    37. tmInternalLeading As Long
    38. tmExternalLeading As Long
    39. tmAveCharWidth As Long
    40. tmMaxCharWidth As Long
    41. tmWeight As Long
    42. tmOverhang As Long
    43. tmDigitizedAspectX As Long
    44. tmDigitizedAspectY As Long
    45. tmFirstChar As Byte
    46. tmLastChar As Byte
    47. tmDefaultChar As Byte
    48. tmBreakChar As Byte
    49. tmItalic As Byte
    50. tmUnderlined As Byte
    51. tmStruckOut As Byte
    52. tmPitchAndFamily As Byte
    53. tmCharSet As Byte
    54. ntmFlags As Long
    55. ntmSizeEM As Long
    56. ntmCellHeight As Long
    57. ntmAveWidth As Long
    58. End Type
    59. Private Declare Function EnumFontFamiliesEx Lib "gdi32" Alias "EnumFontFamiliesExA" (ByVal hdc As Long, lpLogFont As LOGFONT, ByVal lpEnumFontProc As Long, ByVal LParam As Long, ByVal dw As Long) As Long
    60. Private Declare Function GetDC Lib "USER32" (ByVal hWnd As Long) As Long
    61. Private Declare Function ReleaseDC Lib "USER32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
    62. Private Declare Function GetFocus Lib "USER32" () As Long
    63. 'Declare variables required for this module.
    64. Dim WrkCtrl As Control 'will hold the ComboBox or ListBox Control to be filled
    65. Dim FontArray() As String 'The Array that will hold all the Fonts (needed for sorting)
    66. Dim FntInc As Integer 'The FontArray element incremental counter.
    67. Private Function EnumFontFamProc(lpNLF As LOGFONT, lpNTM As NEWTEXTMETRIC, ByVal FontType As Long, LParam As Long) As Long
    68. Dim FaceName As String
    69. 'convert the returned string to Unicode
    70. FaceName = StrConv(lpNLF.lfFaceName, vbUnicode)
    71. 'Dimension the FontArray array variable to hold the next Font Name.
    72. ReDim Preserve FontArray(FntInc)
    73. 'Place the Font name into the newly dimensioned Array element.
    74. FontArray(FntInc) = Left$(FaceName, InStr(FaceName, vbNullChar) - 1)
    75. 'continue enumeration
    76. EnumFontFamProc = 1
    77. 'Increment the Array Element Counter.
    78. FntInc = UBound(FontArray) + 1
    79. End Function
    80. Public Sub EnumFontToControl(ByVal Frm As String, ByVal Ctrl As String)
    81. Dim LF As LOGFONT
    82. Dim hdc As Long
    83. Dim I As Integer
    84. 'Set the WrkCtrl Control variable to the passed
    85. 'control we want to fill wih Font Names. This
    86. 'control must be either a ComboBox or a ListBox.
    87. Set WrkCtrl = Forms(Frm).Controls(Ctrl)
    88. 'Set the Row Source Type for the ComboBox or
    89. 'ListBox to "Value List".
    90. WrkCtrl.RowSourceType = "Value List"
    91. 'Clear the current List (if any) within the
    92. 'control.
    93. WrkCtrl.RowSource = ""
    94. 'Retrieve the DC handle of the ComboBox or ListBox
    95. 'to be filled. The GetHWND function is also used to
    96. 'get the DC.
    97. hdc = GetDC(GetHWND(WrkCtrl))
    98. 'Enumerate the fonts
    99. EnumFontFamiliesEx hdc, LF, AddressOf EnumFontFamProc, ByVal 0&, 0
    100. 'Finished Enumeration. Release the DC.
    101. ReleaseDC GetHWND(WrkCtrl), hdc
    102. 'Sort the FontArray string array.
    103. Call QuickSortStringArray(FontArray(), 0, UBound(FontArray))
    104. 'Fill the Passed ComboBox or ListBox Conrol with the
    105. 'system Fonts found.
    106. For I = 0 To UBound(FontArray)
    107. WrkCtrl.AddItem Item:=FontArray(I)
    108. Next I
    109. 'Free memory...
    110. Set WrkCtrl = Nothing
    111. FntInc = 0
    112. Erase FontArray
    113. End Sub
    114. Public Function GetHWND(Ctrl As Control) As Long
    115. 'This function will get the Handle of a MS-Access
    116. 'Control.
    117. 'Set focus onto the Control we want to get the
    118. 'Handle from (this must be done)
    119. Ctrl.SetFocus
    120. 'Use the API GetFocus Function to retrieve the
    121. 'Handle and return it.
    122. GetHWND = GetFocus&()
    123. End Function
    124. Public Sub QuickSortStringArray(avarIn() As String, ByVal intLowBound As Integer, _
    125. ByVal intHighBound As Integer)
    126. 'GENERAL SUB-PROCEDURE
    127. '=====================
    128. 'Quicksorts the passed array of Strings
    129. 'avarIn() - array of Strings that gets sorted
    130. 'intLowBound - low bound of array
    131. 'intHighBound - high bound of array
    132. 'Declare Variables...
    133. Dim intX As Integer, intY As Integer
    134. Dim varMidBound As Variant, varTmp As Variant
    135. 'Trap Errors
    136. On Error GoTo PROC_ERR
    137. 'If there is data to sort
    138. If intHighBound > intLowBound Then
    139. 'Calculate the value of the middle array element
    140. varMidBound = avarIn((intLowBound + intHighBound) \ 2)
    141. intX = intLowBound
    142. intY = intHighBound
    143. 'Split the array into halves
    144. Do While intX <= intY
    145. If avarIn(intX) >= varMidBound And avarIn(intY) <= varMidBound Then
    146. varTmp = avarIn(intX)
    147. avarIn(intX) = avarIn(intY)
    148. avarIn(intY) = varTmp
    149. intX = intX + 1
    150. intY = intY - 1
    151. Else
    152. If avarIn(intX) < varMidBound Then
    153. intX = intX + 1
    154. End If
    155. If avarIn(intY) > varMidBound Then
    156. intY = intY - 1
    157. End If
    158. End If
    159. Loop
    160. 'Sort the lower half of the array
    161. QuickSortStringArray avarIn(), intLowBound, intY
    162. 'Sort the upper half of the array
    163. QuickSortStringArray avarIn(), intX, intHighBound
    164. End If
    165. PROC_EXIT:
    166. 'Outta here
    167. Exit Sub
    168. PROC_ERR:
    169. 'Display the Error Trapped
    170. MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
    171. "QuickSortStringArray"
    172. 'Jump to...
    173. Resume PROC_EXIT
    174. End Sub



    Gestern, 15:43
    Von harryhirsch


    Nun, ich bin ja nicht gerade der Profi, wenn's um Fonts geht, aber ist es nicht so, dass True Type Schriften frei skalierbar sind, da Vektorgrafiken? Damit wären ja theoretisch alle Grössen "verfügbar". Kann es sein, dass Du aufgrund der Drop-Down-Listen in Word o.ä. davon ausgehst, dass es nur bestimmte Grössen gibt?

    Und vielleicht könntest Du ja noch die einfache Lösung posten, die Du gefunden hast...



    Ich habe dieComboxBox in Access für die Schriftgrößen manuell befüllt mit den Werten von 8 -72. Bei Arial oder Times New Roman funktioniert das Ändern der Schriftgröße wunderbar. Aber einigen ändern leider nicht. Deshalb brauche ich die verfügbaren Schriftgrößen für die asgewählte Schriftart. Denn es sollen alle auf dem System installierten Schriftarten angeboten werden.

    Gruß
    Wenn ich es richtig sehe brauchst Du die GetTextMetrics-API. siehe hier activevb.de/tipps/vb6tipps/tipp0537.html.
    Das Beispiel müsste relative einfach umsetzbar sein.

    Aber wieso nutzt Du nicht den eingebauten Dialog siehe hier accessruncommand.com/codeex/19.htm
    NB. Es ist doch schön, wenn man lesbare Namen vergibt. Siehe auch [VB.NET] Beispiele für guten und schlechten Code (Stil).

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „INOPIAE“ ()

    moin moin,

    @INOPIAE

    ich weiß zwar mom nicht wie mir das Bsp. von activevb.de helfen soll, aber die Idee mit der GetTextMetrics-API ist interessant. Werde ich mir mal anschauen.

    Den eingebaute Standarddialog möchte ich ja nicht nutzen, weil ich die Schriftarten und deren verfügbare Schriftgrößen in einer separaten ComboBox darstellen möchte. Und das muss doch irgendwie machbar sein...

    Die Schriftarten habe ich bereits geladen in einer ComboBox, nun fehlt mir also die ComboBox für die Schriftgrößen....

    Gruss