Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Why my TreeView cannot show icon

Why my TreeView cannot show icon

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasehelpquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joshua0137
    wrote on last edited by
    #1

    i create a treeview in a wnd derived from CWindowImpl ( i use atl), and i create a imglistctrl for the treeview, everything seems ok of the imagelist, and i assign a image index for every node of the trewview, but no icon shows, and a small empty rect keeps at the left of every node's, anyone can help me?

    class CJMainForm : public CWindowImpl
    {
    public:
    DECLARE_WND_CLASS("JMainFrameClass")

    CJMainForm(void);
    ~CJMainForm(void);
    BOOL ShowForm(BOOL bShow = TRUE);
    
    BEGIN\_MSG\_MAP( CJMainForm )
    	MESSAGE\_HANDLER( WM\_PAINT, OnPaint)
    	MESSAGE\_HANDLER(WM\_LBUTTONDOWN,	OnLButtonDown)
    	MESSAGE\_HANDLER(WM\_MOUSEMOVE, OnMouseMove)
    	MESSAGE\_HANDLER(WM\_ERASEBKGND, OnEraseBkgnd)
    	MESSAGE\_HANDLER(WM\_QUERYENDSESSION, OnQueryEndSession)
    END\_MSG\_MAP()
    

    public:
    CXAnalogClock m_wndClock;
    CCalenderWnd m_wndCalender;
    CWindow m_wndPrjTree;
    HBRUSH m_brBackGround;
    SIZE m_szbrBackGround;

    protected:
    LRESULT OnPaint( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
    LRESULT OnLButtonDown( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
    LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnQueryEndSession(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

    HICON m\_icoExit;
    HICON m\_icoPrevYear;
    HICON m\_icoNextYear;
    HICON m\_icoPrevMonth;
    HICON m\_icoNextMonth;
    HICON m\_icoToday;
    HFONT m\_icoTextFont;
    int m\_CurrentRegion, m\_nOldRegion;
    
    HICON m\_icoNodeClosed;
    HICON m\_cioNodeOpen;
    HICON m\_icoAttrib;
    enum EnToolBtnState
    {
    	tbs\_normal = 0,
    	tbs\_hover,
    	tbs\_prress\_down,
    }m\_nToolBtnState\[6\];
    RECT m\_rcToolBtn\[6\];
    
    HBRUSH m\_brToolBtnHover;
    int m\_nLastToolBtnHit;
    
    enum SKIN
    {
    	cpbob = 0,
    	cpnobob,
    	darkblue,
    	silver,
    	gold,
    	black,
    	lightblue,
    	green,
    	red,
    	rose,
    	aqua,
    	neonblue,
    	bluestreak,
    	crystalgreen,
    	crystalblack,
    	crystalblue,
    	crystalred,
    	crystalyellow,
    	silverring,
    	minimal,
    	white,
    };
    
    void SetSkin();
    
    struct SKIN\_MENU\_DATA
    {
    	UINT nID;
    	UINT nClockFaceBitmapId;
    	UINT nDateBitmapId;
    	TCHAR \*pszName;
    };
    static SKIN\_MENU\_DATA	m\_Skins\[\];
    static int				m\_nSkins;
    SKIN					m\_eSkin;
    ATL::CString m\_strSkin;
    
    SKIN GetSkinFromName(LPCTSTR lpszSkinName);
    

    private:
    void ParseNode(IDispatch* pNode,HTREEITEM hParent);
    HTREEITEM CJMainForm::InsertTreeItem(HTREEITEM hItem, LPCTSTR lpszItem, int nImage,
    int nSelec

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups