Click here to Skip to main content
15,908,254 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Shortcut for select all e.i Ctrl+A not working Pin
Le@rner13-Oct-08 18:05
Le@rner13-Oct-08 18:05 
GeneralRe: Shortcut for select all e.i Ctrl+A not working Pin
Michael Schubert13-Oct-08 21:07
Michael Schubert13-Oct-08 21:07 
QuestionButton Click event Pin
Dhiraj kumar Saini13-Oct-08 1:57
Dhiraj kumar Saini13-Oct-08 1:57 
AnswerRe: Button Click event Pin
CPallini13-Oct-08 2:07
mveCPallini13-Oct-08 2:07 
GeneralRe: Button Click event Pin
Dhiraj kumar Saini13-Oct-08 18:46
Dhiraj kumar Saini13-Oct-08 18:46 
GeneralRe: Button Click event Pin
Hamid_RT13-Oct-08 19:28
Hamid_RT13-Oct-08 19:28 
AnswerRe: Button Click event Pin
Hamid_RT13-Oct-08 7:42
Hamid_RT13-Oct-08 7:42 
AnswerRe: Button Click event Pin
Nelek14-Oct-08 0:35
protectorNelek14-Oct-08 0:35 
If you are working with MFC you can just create the function of the OnButtonClick using the Wizard (if you are not so self confident to make it by yourself) and then just call the function where you want, when you want.

For example:

in your view/dialog header

public:
	//{{AFX_DATA(CYourView)
	enum { IDD = IDD_MY_VIEW};
	CButton	m_cbTest;
.
.
	//{{AFX_MSG(CSPSMonitorView)
	afx_msg void OnBTestClick();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()


and in your code file

void CYourView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CYourView)
	DDX_Control(pDX, IDC_BTEST, m_cbTest);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CYourView, CFormView)
	//{{AFX_MSG_MAP(CYourView)
	ON_BN_CLICKED(IDC_BTEST, OnBTestClick)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


and after...

void CYourView::OnBTestClick() 
{
your code...
}


and then you can call the OnBTestClick when you want

Regards.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.

Question/OPT:WIN98 setting ¿still useful? Pin
Jose David Pujo13-Oct-08 1:46
Jose David Pujo13-Oct-08 1:46 
AnswerRe: /OPT:WIN98 setting ¿still useful? Pin
Rajesh R Subramanian13-Oct-08 1:54
professionalRajesh R Subramanian13-Oct-08 1:54 
GeneralRe: /OPT:WIN98 setting ¿still useful? Pin
Jose David Pujo13-Oct-08 1:57
Jose David Pujo13-Oct-08 1:57 
AnswerRe: /OPT:WIN98 setting ¿still useful? Pin
Michael Schubert13-Oct-08 1:57
Michael Schubert13-Oct-08 1:57 
GeneralRe: /OPT:WIN98 setting ¿still useful? Pin
Jose David Pujo13-Oct-08 1:59
Jose David Pujo13-Oct-08 1:59 
GeneralRe: /OPT:WIN98 setting ¿still useful? Pin
Michael Schubert13-Oct-08 2:04
Michael Schubert13-Oct-08 2:04 
GeneralRe: /OPT:WIN98 setting ¿still useful? Pin
Jose David Pujo13-Oct-08 2:06
Jose David Pujo13-Oct-08 2:06 
QuestionMake Setup file... Pin
m_mun13-Oct-08 1:18
m_mun13-Oct-08 1:18 
AnswerRe: Make Setup file... Pin
Cedric Moonen13-Oct-08 1:21
Cedric Moonen13-Oct-08 1:21 
AnswerRe: Make Setup file... Pin
SandipG 13-Oct-08 1:27
SandipG 13-Oct-08 1:27 
AnswerRe: Make Setup file... Pin
Hamid_RT13-Oct-08 8:03
Hamid_RT13-Oct-08 8:03 
Questionis there a Template for ISAPI filter creation in vs2005? Pin
Mostafa Siraj12-Oct-08 23:52
Mostafa Siraj12-Oct-08 23:52 
AnswerRe: is there a Template for ISAPI filter creation in vs2005? Pin
led mike13-Oct-08 5:37
led mike13-Oct-08 5:37 
QuestionHow does this driver hold the read data before returning? Pin
kcynic12-Oct-08 23:26
kcynic12-Oct-08 23:26 
AnswerRe: How does this driver hold the read data before returning? Pin
_chew14-Oct-08 3:49
_chew14-Oct-08 3:49 
GeneralRe: How does this driver hold the read data before returning? Pin
kcynic14-Oct-08 4:11
kcynic14-Oct-08 4:11 
QuestionProblem with spanish accents Pin
Member 470854412-Oct-08 23:24
Member 470854412-Oct-08 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.