Function Reference

_GUICtrlTab_SetItemText

タブのテキストを設定します。

#Include <GuiTab.au3>
_GUICtrlTab_SetItemText($hWnd, $iIndex, $sText)

 

パラメータ

$hWnd コントロールのハンドル
$iIndex ゼロ始まりのアイテムインデックス
$sText アイテムテキスト

 

返し値

成功: True
失敗: False

 

注意

なし。

 

関連

_GUICtrlTab_GetItemText

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiTab.au3>

Opt('MustDeclareVars', 1)

$Debug_TAB = False ; 関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

_Main()

Func _Main()
    Local $hTab

    ; GUIを作成
    GUICreate("Tab Control Set Item Text", 400, 300)
    $hTab = GUICtrlCreateTab(2, 2, 396, 296)
    GUISetState()

    ; タブを追加
    _GUICtrlTab_InsertItem($hTab, 0, "Tab 1")
    _GUICtrlTab_InsertItem($hTab, 1, "Tab 2")
    _GUICtrlTab_InsertItem($hTab, 2, "Tab 3")
   
    ; タブ1のテキストを取得/設定
    _GUICtrlTab_SetItemText($hTab, 0, "New Text")
    MsgBox(4160, "Information", "Tab 1 text: " & _GUICtrlTab_GetItemText($hTab, 0))

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main