Function Reference

_ChooseFont

ユーザーが論理フォントの属性を選択するためのフォントダイアログボックスを作成します。

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

 

パラメータ

$sFontName [オプション]デフォルトのフォント名
$iPointSize [オプション]フォントのポイントサイズ
$iColorRef [オプション]COLORREF型 RGB色
$iFontWeight [オプション]フォントの太さ
$iItalic [オプション]斜体
$iUnderline [オプション]下線
$iStrikethru [オプション]取り消し線
$hWndOwnder [オプション]ダイアログボックスを所有するウィンドウのハンドル

 

返し値

成功: 次に示す形式の配列。
[0] - 要素数が格納されています
[1] - 属性 = 斜体:2, 下線:4, 取り消し線:8 のBitOr結果
[2] - フォント名
[3] - フォントサイズ = ポイントサイズ
[4] - フォントの太さ = = 0-1000
[5] - COLORREF型 RGB色
[6] - BGR色 16進数
[7] - RGB色 16進数
失敗: -1

 

注意

なし。

 

関連

 


#include <Misc.au3>

Local $a_font

; 例 1
$a_font = _ChooseFont("Arial", 8)
If (@error) Then
    MsgBox(0, "", "Error _ChooseFont: " & @error)
Else
    MsgBox(0, "", "Font Name: " & $a_font[2] & @LF & "Size: " & $a_font[3] & @LF & "Weight: " & $a_font[4] & @LF & "COLORREF rgbColors: " & $a_font[5] & @LF & "Hex BGR Color: " & $a_font[6] & @LF & "Hex RGB Color: " & $a_font[7])
EndIf

; 例 2
$a_font = _ChooseFont()
If (@error) Then
    MsgBox(0, "", "Error _ChooseFont: " & @error)
    Exit
Else
    MsgBox(0, "", "Font Name: " & $a_font[2] & @LF & "Size: " & $a_font[3] & @LF & "Weight: " & $a_font[4] & @LF & "COLORREF rgbColors: " & $a_font[5] & @LF & "Hex BGR Color: " & $a_font[6] & @LF & "Hex RGB Color: " & $a_font[7])
EndIf

; 例 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, "", "Error _ChooseFont: " & @error)
Else
    MsgBox(0, "", "Font Name: " & $a_font[2] & @LF & "Size: " & $a_font[3] & @LF & "Weight: " & $a_font[4] & @LF & "COLORREF rgbColors: " & $a_font[5] & @LF & "Hex BGR Color: " & $a_font[6] & @LF & "Hex RGB Color: " & $a_font[7])
EndIf