Funktionsreferenz

_ChooseFont

Zeigt einen Schriftauswahldialog an, mit dem der Benutzer eine Schrift und deren Attribute wählen kann.

#Include <Misc.au3>
_ChooseFont([$sFontName = "Courier New" [, $iPointSize = 10 [, $iColorRef = 0 [, $iFontWeight = 0 [, $iItalic = False [, $iUnderline = False [, $iStrikethru = False [, $hWndOwner = 0]]]]]]]])

 

Parameter

$sFontName [optional] Standard Schriftname
$iPointSize [optional] Punktgröße der Schrift
$iColorRef [optional] COLORREF RGB Farbwert
$iFontWeight [optional] "Gewicht" der Schrift (Normal/Fett)
$iItalic [optional] Kursiv
$iUnderline [optional] Unterstreichung
$iStrikethru [optional] Durchstreichung
$hWndOwner [optional] Handle des Fensters, zu dem die Dialogbox gehört

 

Rückgabewert

Erfolg: Array mit folgender Struktur:
[0] - enthält die Anzahl der Elemente
[1] - Attribute = BitOR von kursiv:2, Unterstreichung:4, Durchstreichung:8
[2] - Schriftname
[3] - Schriftgröße = Punktgröße
[4] - Schriftgewicht = 0-1000
[5] - COLORREF RGB Farbwert
[6] - Hex BGR Color
[7] - Hex RGB Color

 

Bemerkungen

Keine.

 

Verwandte Funktionen

 

Beispiel


#include <Misc.au3>

Local $a_font

; Beispiel 1
$a_font = _ChooseFont("Arial", 8)
If (@error) Then
    MsgBox(0, "", "_ChooseFont-Fehler: " & @error)
Else
    MsgBox(0, "", "Schriftname: " & $a_font[2] & @LF & "Größe: " & $a_font[3] & @LF & "Gewicht: " & $a_font[4] & @LF & "COLORREF-rgb-Farben: " & $a_font[5] & @LF & "Hex BGR-Farbe: " & $a_font[6] & @LF & "Hex RGB-Farbe: " & $a_font[7])
EndIf

; Beispiel 2
$a_font = _ChooseFont()
If (@error) Then
    MsgBox(0, "", "_ChooseFont-Fehler: " & @error)
    Exit
Else
    MsgBox(0, "", "Schriftname: " & $a_font[2] & @LF & "Größe: " & $a_font[3] & @LF & "Gewicht: " & $a_font[4] & @LF & "COLORREF-rgb-Farben: " & $a_font[5] & @LF & "Hex BGR-Farbe: " & $a_font[6] & @LF & "Hex RGB-Farbe: " & $a_font[7])
EndIf

; Beispiel 3
Local $FontName = $a_font[2]
Local $FontSize = $a_font[3]
Local $ColorRef = $a_font[5]
Local $FontWeight = $a_font[4]
Local $Italic = BitAND($a_font[1], 2)
Local $Underline = BitAND($a_font[1], 4)
Local $Strikethru = BitAND($a_font[1], 8)
$a_font = _ChooseFont($FontName, $FontSize, $ColorRef, $FontWeight, $Italic, $Underline, $Strikethru)
If (@error) Then
    MsgBox(0, "", "_ChooseFont-Fehler: " & @error)
Else
    MsgBox(0, "", "Schriftname: " & $a_font[2] & @LF & "Größe: " & $a_font[3] & @LF & "Gewicht: " & $a_font[4] & @LF & "COLORREF-rgb-Farben: " & $a_font[5] & @LF & "Hex BGR-Farbe: " & $a_font[6] & @LF & "Hex RGB-Farbe: " & $a_font[7])
EndIf