Export (0) Print
Expand All
MFC
Expand Minimize

CToolBarCtrl::SetPressedImageList

Sets the image list that the current toolbar control uses to represent buttons in the pressed state.

CImagelist* SetPressedImageList(
            int iImageID, 
            CImageList* pImageList
);

Parameter

Description

[in] iImageID

The zero-based index of the image list. Set this parameter to zero if you use only one image list.

[in] pImageList

Pointer to a CImageList that contains the new image list.

Pointer to a CImageList that contains the previous image list for the current control, or NULL if no such image list was set.

This method sends the TB_SETPRESSEDIMAGELIST message, which is described in the Windows SDK.

Header: afxcmn.h

This control is supported in Windows Vista and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

The following code example sets the pressed image list to be the same as the default image list.

	{
		// SetPressedImageList 
		// Set the pressed image list to be the same as the  
		// normal image list.
		CToolBarCtrl& m_toolBarCtrl = m_wndToolBar.GetToolBarCtrl();
		CImageList* pNormalCil =  m_toolBarCtrl.GetImageList();
		CImageList* pPressedCil = m_toolBarCtrl.GetPressedImageList();
		m_toolBarCtrl.SetPressedImageList( 0, pNormalCil );
	}

Community Additions

ADD
Show:
© 2014 Microsoft