Function Reference

_GUICtrlTreeView_SetDropTarget

アイテムがドラッグ&ドロップのターゲットとして描画されているかどうかを設定します。

#Include <GuiTreeView.au3>
_GUICtrlTreeView_SetDropTarget($hWnd, $hItem[, $fFlag = True])

 

パラメータ

$hWnd コントロールのハンドル
$hItem アイテムのハンドル
$fFlag [オプション]フラグの設定:
 True - アイテムをドラッグ&ドロップのターゲットとして描画します
False - アイテムをドラッグ&ドロップのターゲットとして描画しません

 

返し値

成功: True
失敗: False

 

注意

なし。

 

関連

_GUICtrlTreeView_GetDropTarget

 


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

Opt('MustDeclareVars', 1)

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

_Main()

Func _Main()

    Local $hItem[6], $hRandomItem, $hTreeView
    Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)

    GUICreate("TreeView Set Drop Target", 400, 300)

    $hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)
    GUISetState()

    _GUICtrlTreeView_BeginUpdate($hTreeView)
    For $x = 0 To UBound($hItem) - 1
        $hItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x + 1), $hTreeView)
    Next
    _GUICtrlTreeView_EndUpdate($hTreeView)

    $hRandomItem = Random(0, UBound($hItem) - 1, 1)
    MsgBox(4160, "Information", StringFormat("Item %d Drop Target? %s", $hRandomItem, _GUICtrlTreeView_GetDropTarget($hTreeView, $hItem[$hRandomItem])))
    _GUICtrlTreeView_SetDropTarget($hTreeView, $hItem[$hRandomItem])
    MsgBox(4160, "Information", StringFormat("Item %d Drop Target? %s", $hRandomItem, _GUICtrlTreeView_GetDropTarget($hTreeView, $hItem[$hRandomItem])))

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