Funktionreferenz


_ChooseFont

Beschreibung anzeigen in

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 [, $iFontColorRef = 0 [, $iFontWeight = 0 [, $bItalic = False [, $bUnderline = False [, $bStrikethru = False [, $hWndOwner = 0]]]]]]]] )

Parameter

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

Rückgabewert

Erfolg: Ein 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
Fehler: Setzt das @error Flag auf ungleich null

Beispiel

Beispiel 1

#include <Misc.au3>
#include <MsgBoxConstants.au3>

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


Beispiel 2

#include <Misc.au3>
#include <MsgBoxConstants.au3>

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


Beispiel 3

#include <Misc.au3>
#include <MsgBoxConstants.au3>

Local $a_vFont = _ChooseFont()

Local $sFontName = $a_vFont[2]
Local $iFontSize = $a_vFont[3]
Local $iColorRef = $a_vFont[5]
Local $iFontWeight = $a_vFont[4]
Local $bItalic = BitAND($a_vFont[1], 2)
Local $bUnderline = BitAND($a_vFont[1], 4)
Local $bStrikethru = BitAND($a_vFont[1], 8)
$a_vFont = _ChooseFont($sFontName, $iFontSize, $iColorRef, $iFontWeight, $bItalic, $bUnderline, $bStrikethru)
If (@error) Then
    MsgBox($MB_SYSTEMMODAL, "", "_ChooseFont-Fehler: " & @error)
Else
    MsgBox($MB_SYSTEMMODAL, "", "Schriftname: " & $a_vFont[2] & @CRLF & "Größe: " & $a_vFont[3] & @CRLF & "Gewicht: " & $a_vFont[4] & @CRLF & "COLORREF-rgb-Farben: " & $a_vFont[5] & @CRLF & "Hex BGR-Farbe: " & $a_vFont[6] & @CRLF & "Hex RGB-Farbe: " & $a_vFont[7])
EndIf