Wie kann ich einen Icon in Tabs einbinden?

  • Hallo Community
    Ja, wie gesagt..
    Wie kann ich einen Icon (.ico) in einen Tab einbinden...
    Hab in der Autoit Hilfe schon nachgesehen aber die nehmen da überall nur

    [autoit]

    _GUICtrlListView_CreateSolidBitMap($listview, 0xFF0000, 11, 11)

    [/autoit]

    her
    ....
    Danke mal im Voraus!

    • Offizieller Beitrag

    Meinst du sowas?

    Spoiler anzeigen
    [autoit]

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

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)

    [/autoit] [autoit][/autoit] [autoit]

    $Debug_TAB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

    [/autoit] [autoit][/autoit] [autoit]

    _Main()

    [/autoit] [autoit][/autoit] [autoit]

    Func _Main()
    Local $hGUI, $hImage, $hTab

    [/autoit] [autoit][/autoit] [autoit]

    ; Create GUI
    $hGUI = GUICreate("Tab Control Set Image List", 400, 300)
    $hTab = GUICtrlCreateTab(2, 2, 396, 296)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    ; Create images
    $hImage = _GUIImageList_Create()
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 4)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 10)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 14)
    _GUICtrlTab_SetImageList($hTab, $hImage)

    [/autoit] [autoit][/autoit] [autoit]

    ; Add tabs
    _GUICtrlTab_InsertItem($hTab, 0, "Tab 1", 0)
    _GUICtrlTab_InsertItem($hTab, 1, "Tab 2", 1)
    _GUICtrlTab_InsertItem($hTab, 2, "Tab 3", 2)

    [/autoit] [autoit][/autoit] [autoit]

    ; Show image list handle
    MsgBox(4160, "Information", "Image list handle: 0x" & Hex(_GUICtrlTab_GetImageList($hTab)))

    [/autoit] [autoit][/autoit] [autoit]

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
    EndFunc ;==>_Main

    [/autoit]
  • Danke, genau das habe ich gesucht!
    :P

    Aber das UDF ist auch ziemlich cool