函数参考


_GUICtrlButton_GetNote

获取命令链接按钮关联的注释文字

#include <GuiButton.au3>
_GUICtrlButton_GetNote($hWnd)

参数

$hWnd 控件的控件ID/句柄

返回值

成功: 返回命令按钮的关联文本
失败: 返回 ""

注意/说明

该函数只作用于有 $BS_COMMANDLINK and $BS_DEFCOMMANDLINK 样式的按钮

最低操作系统: Windows Vista

相关

_GUICtrlButton_SetNote, _GUICtrlButton_GetNoteLength

详情参考

在MSDN中搜索


示例/演示


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

Global $iMemo

; Note the controlID from these button(s) can NOT be read with GUICtrlRead.

_Main()

Func _Main()
    Local $hButton, $hGUI

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

    $hButton = _GUICtrlButton_Create($hGUI, "Button1", 10, 10, 160, 60, BitOR($BS_COMMANDLINK, $BS_DEFCOMMANDLINK))
    _GUICtrlButton_SetNote($hButton, "This is a test of Vista")

    GUISetState()

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

    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