tags:

views:

45

answers:

4

m_pButton->Create(L"ABC", WS_CHILD | WS_VISIBLE| BM_SETIMAGE,CRect(0,0,100,100),this,ID_BUTTON1); m_pButton->SetIcon(::LoadIcon(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON1)));

//above show neither showing image nor showing text.

+2  A: 

BM_SETIMAGE is not a button style, but a message which is sent to the window in order to set a bitmap. What you probably want is the BS_BITMAP style. Unfortunately as far as I know, it is not possible to have both text and a bitmap on a standard button. But you should find plenty of working implementations of a custom button class on sites like codeguru or codeproject.

humbagumba
thanks.....:) for ur reply
you're welcome!
humbagumba
+1  A: 

You might use CMFCButton if you are using VS 2008 SP1 or higher.

Javier De Pedro
A: 

WPF might be able to do this. But, changing GUI topkits might not be an option anyway.

zooropa
A: 

You could override the DrawItem method in CButton. For details check out the following links:

CButton::DrawItem

Owner drawn button - step by step

anand.arumug