Opened 15 years ago

Closed 15 years ago

#497 closed Bug (Works For Me)

GUICtrlSetFont() does not work in a listview control

Reported by: HeidiR Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


GUICtrlSetFont($LV_AR[$i], 8.5, 800) ;Bold

Attachments (0)

Change History (3)

comment:1 Changed 15 years ago by Gary

comment:2 Changed 15 years ago by Jpm

adding GUICtrlSetFont to the GuiCtrlCreateListView example works for me

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

Opt('MustDeclareVars', 1)


Func Example()
    Local $listview, $button, $item1, $item2, $item3, $input1, $msg
    GUICreate("test GuiCtrlSetFont ListView", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
    GUISetBkColor(0x00E0FFFF)  ; will change background color

    $listview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)

    GUICtrlSetFont($listview, 8.5, 800) ;Bold
	$button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)
    $item1 = GUICtrlCreateListViewItem("item2|col22|col23", $listview)
    $item2 = GUICtrlCreateListViewItem("item1|col12|col13", $listview)
    $item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview)
    $input1 = GUICtrlCreateInput("", 20, 200, 150)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)   ; to allow drag and dropping
    GUICtrlSetData($item2, "ITEM1")
    GUICtrlSetData($item3, "||COL33")

        $msg = GUIGetMsg()
            Case $msg = $button
                MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
            Case $msg = $listview
                MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

comment:3 Changed 15 years ago by Jpm

  • Resolution set to Works For Me
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.