函数参考


_GUICtrlButton_SetNote

设置与命令按钮有关的提示文本

#include <GuiButton.au3>
_GUICtrlButton_SetNote($hWnd, $sNote)

参数

$hWnd 控件的控件ID/句柄
$sNote 包含提示的字符串

返回值

成功: 返回 True
失败: 返回 False

注意/说明

最低操作系统: Windows Vista.

相关

_GUICtrlButton_GetNote, _GUICtrlButton_GetNoteLength

详情参考

在MSDN中搜索


示例/演示


#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>
#include <GuiMenu.au3>

Global $btn, $iMemo

; Note the controlId from these button(s) can NOT be read with GuiCtrlRead

_Main()

Func _Main()
    Local $hGUI

    $hGUI = GUICreate("Buttons", 400, 400)
    $iMemo = GUICtrlCreateEdit("", 10, 65, 390, 325, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

    $btn = _GUICtrlButton_Create($hGUI, "Button1", 10, 10, 160, 40, BitOR($BS_COMMANDLINK, $BS_DEFPUSHBUTTON, $BS_PUSHLIKE))
    _GUICtrlButton_SetNote($btn, "This is a test of Vista")

    GUISetState()

    MemoWrite("Note: " & _GUICtrlButton_GetNote($btn))
    MemoWrite("Note Length: " & _GUICtrlButton_GetNoteLength($btn))
    MemoWrite("Button Text: " & _GUICtrlButton_GetText($btn))

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

    Exit

EndFunc   ;==>_Main

; 写入一行到 memo 控件
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite