(最初の)選択された段落、または(選択されていない場合)現在の段落の影の設定を取得します。
#Include <GuiRichEdit.au3>
_GUICtrlRichEdit_GetParaShading($hWnd)
パラメータ
| $hWnd | コントロールのハンドル |
返し値
| 成功: | 最初の選択された段落の設定 - セミコロン(:)で区切られた値で構成された文字列: |
| 値1 - 重み - 前景色のパーセント。残りは背景色。 | |
| 値2 - スタイル - 以下のいずれかを格納した文字列: | |
| non - 無し | |
| dhz - 水平方向に影付け | |
| dvt - 垂直方向に影付け | |
| ddd - 斜め下向きに影付け | |
| dud - 斜め上向きに影付け | |
| dgr - 網状に影付け | |
| dtr - 格子状に影付け | |
| lhz - 水平方向に明るくする | |
| lvt - 垂直方向に明るくする | |
| ldd - 斜め下向きに明るくする | |
| lud - 斜め上向きに明るくする | |
| lgr - 網状に明るくする | |
| ltr - 格子状に明るくする | |
| 値3 - 前景色 - 以下のいずれか: | |
| "blk" - 黒 | |
| "blu" - 青 | |
| "cyn" - シアン | |
| "grn" - 緑 | |
| "mag" - マゼンタ | |
| "red" - 赤 | |
| "yel" - 黄 | |
| "whi" - 白 | |
| "dbl" - ダークブルー | |
| "dgn" - ダークグリーン | |
| "dmg" - ダークマゼンタ | |
| "drd" - ダークレッド | |
| "dyl" - ダークイエロー | |
| "dgy" - ダークグレー | |
| "lgy" - ライトグレー | |
| 値4 - 背景色 - 前景色と同様の値 | |
| 値5 - 範囲: | |
| a - 選択された全て(または最初)の段落に設定されています。 | |
| f - 最初の選択された段落にのみ設定されています。 | |
| c - 現在の段落に設定されています。 | |
| 失敗: | ""を返し、@errorを設定します。 |
| @error: | 101 - $hWndがハンドルではありません。 |
注意
影付けはリッチエディットでは表示されませんがWordでは表示されます。
関連
_GUICtrlRichEdit_SetParaShading
こちらも参照
MSDNライブラリでEM_SETPARAFORMATを検索して下さい。
例
#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $lblMsg, $hRichEdit
Main()
Func Main()
Local $hGui, $iMsg, $btnNext, $iStep = 0
$hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
$lblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60)
$btnNext = GUICtrlCreateButton("Next", 270, 310, 40, 30)
GUISetState()
_GuiCtrlRichEdit_SetText($hRichEdit, "First paragraph")
Report("0. Para with default settings")
While True
$iMsg = GUIGetMsg()
Select
Case $iMsg = $GUI_EVENT_CLOSE
GUIDelete()
Exit
Case $iMsg = $btnNext
$iStep += 1
Switch $iStep
Case 1
_GuiCtrlRichEdit_AppendText($hRichEdit, @CR & "Second paragraph")
_GUICtrlRichEdit_SetParaShading($hRichEdit, 60, "ddd", "blu", "dmg")
Report("1. Shading of second paragraph is ")
Case 2
_GuiCtrlRichEdit_SetSel($hRichEdit, 0, 2)
Report("2. Style of first paragraph in the selection is ")
Case 3
_GuiCtrlRichEdit_SetSel($hRichEdit, 10, 26)
_GUICtrlRichEdit_SetParaShading($hRichEdit, Default, "dgr")
Report("3. Change shading of both paragraphs")
Case 4
; Wordで設定を確認できるように全てのテキストをデスクトップに保存
_GuiCtrlRichEdit_Deselect($hRichEdit)
_GuiCtrlRichEdit_StreamToFile($hRichEdit, @DesktopDir & "\gcre.rtf")
GUICtrlSetState($btnNext, $GUI_DISABLE)
EndSwitch
EndSelect
WEnd
EndFunc ;==>Main
Func Report($sMsg)
$sMsg = $sMsg & @CR & @CR & "Get function returns " & @CR & _GUICtrlRichEdit_GetParaShading($hRichEdit)
GUICtrlSetData($lblMsg, $sMsg)
ControlFocus($hRichEdit, "", "")
EndFunc ;==>Report