Announcement

Collapse
No announcement yet.

Treeview font,graphic help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Treeview font,graphic help

    I have a treeview working ok but don't find any examples of how to change the font, or add a little graphic as in Explorer. The Petzold example didn't go into it. Any links or code snippets would be welcomed.

    Thanks,

    Bob Mechler

  • #2
    Found a good example of adding imagelist in the Samples directory in the Interface Explorer (final). Changing font works fine with a standard WM_SETFONT.

    Thanks anyway.

    Bob Mechler

    Comment


    • #3
      WM_SETFONT should work to change the font.

      And icons you can set using the 'iImage' member of TVITEM structure, where iImage is an index in an image list assigned to the control with TVM_SETIMAGELIST message.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        From PB Samples directory Interface Explorer and one or two other places. This works great.

        Code:
                CONTROL ADD "SysTreeView32", hdlg,%ID_TREE1, "", 92, 10, 120, 208, _
                   %WS_CHILD OR %WS_VISIBLE OR %TVS_HASBUTTONS OR %TVS_HASLINES OR _
                 %TVS_LINESATROOT OR %TVS_SHOWSELALWAYS OR %TVS_TRACKSELECT, %WS_EX_STATICEDGE
                CONTROL SEND hdlg&, %ID_TREE1, %WM_SETFONT, hFontCap, 0
                CONTROL HANDLE hdlg, %ID_TREE1 TO hTree&(1)
                ' Create our icon image list for the TREEVIEW
                hImageList& = ImageList_Create( 16, 16, %ILC_MASK, 3, 1 )
                hInstance& = GetModuleHandle(BYVAL %NULL)
                CALL ImageList_AddIcon(hImageList&, LoadIcon(hInstance&, "MENU_TV")) 'WAS TNET
                CONTROL SEND hDlg,%ID_TREE1, %TVM_SETIMAGELIST, %TVSIL_NORMAL, hImageList&

        Comment

        Working...
        X