Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to add icon on CExtButton. Collapse All
Subject Author Date
L Freddi Dec 2, 2009 - 4:45 AM

Hi, I want to add icon on CExtbutton.


As your sample, I use AssignFromHICON() but i couldn’t see icon.


below see my code, please help me.


======================================================


CExtButton m_ctrlBtnExample;


 m_ctrlBtnExample.SetWindowPos(NULL, dwX, dwY, 120, 70, NULL);

 m_ctrlBtnExample.m_icon.AssignFromHICON(

  (HICON) ::LoadImage(

  ::AfxGetInstanceHandle(),

  MAKEINTRESOURCE(IDI_ICON1),

  IMAGE_ICON,

  32,

  32,

  0

  ),

  false

  );


=======================================================

Technical Support Dec 2, 2009 - 7:32 AM

Your code is absolutely correct. You can find the same code in the CPageButtons::OnInitDialog() method in the ProfUIS_Controls sample application and that’s why the CExtButton windows on the Buttons dialog page display icons. Please check whether the LoadImage() API returns a non-NULL icon handle.