Click here to Skip to main content
16,016,134 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi everyone,

I want to glarify one thing in my SDI application.I have a button in SDI.I know it is easy to do an action in Dialog based application, but is it possible to make an event on the button click in SDI. I have created a button in SDI as follows,

CButton *pButton;
pButton = new CButton;
//OnInitialUpdate()
pButton->Create("&Sub",WS_VISIBLE,CRect(782,682,806,716),this,0x302);


How to make an action on Button click(like changing ellipse color,background color)?.

Shiva..
Posted
Updated 17-Mar-10 2:54am
v2

1 solution

Try it :)
// resource.h
#define IDC_YOUR_BTN  0x302
 
// yourview.cpp
BEGIN_MESSAGE_MAP(CYourView, CBaseOfYourView)
  ON_COMMAND(IDC_YOUR_BTN, OnYourButtonClick)
...
END_MESSAGE_MAP()
 
...
/*afx_msg*/ void CYourView::OnYourButtonClick()
{
  /* wir are inside :) */
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900