Click here to Skip to main content
15,888,177 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get the keyboard event? Pin
sharanu14-May-11 23:06
sharanu14-May-11 23:06 
AnswerRe: How to get the keyboard event? Pin
«_Superman_»15-May-11 2:00
professional«_Superman_»15-May-11 2:00 
AnswerRe: How to get the keyboard event? Pin
Mark Salsbery15-May-11 8:39
Mark Salsbery15-May-11 8:39 
QuestionEdit Text Pin
john563214-May-11 22:46
john563214-May-11 22:46 
AnswerRe: Edit Text Pin
Mark Salsbery14-May-11 22:58
Mark Salsbery14-May-11 22:58 
AnswerRe: Edit Text Pin
Hans Dietrich14-May-11 23:08
mentorHans Dietrich14-May-11 23:08 
AnswerRe: Edit Text Pin
Alain Rist14-May-11 23:15
Alain Rist14-May-11 23:15 
QuestionLButtonDown Event on Button Pin
sharanu14-May-11 22:00
sharanu14-May-11 22:00 
Hi All,
I am trying to create a application,where,
when i click the button and hold the mouse the value should be incrementing until i release the mouse button.
How can i do it.

I am tying with below code:

void CTestDlg::OnButtonUp() 
{
	// TODO: Add your control notification handler code here

    UpdateData(TRUE);
	m_strvalue++; // edit box member function incrementing
	UpdateData(FALSE);


}

void CTestDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
  	if(flag_value==1)
	{
	       	m_strvalue++;
		UpdateData(FALSE);
	
	}
	}

void CTestDlg::OnLButtonUp(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	flag_value=0;
	CDialog::OnLButtonUp(nFlags, point);
}

void CTestDlg::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	flag_value=1;
	CDialog::OnLButtonDown(nFlags, point);
}


I am calling this OnLButtonUp event,but it is for whole dialog.i.e wherever i click and hold mouse on dialog the value is incrementing.
I want the same action on OnButtonUp(i.e when i click and hold the Button)


Thanks in advance

Sharan
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan

AnswerRe: LButtonDown Event on Button Pin
Hans Dietrich14-May-11 22:53
mentorHans Dietrich14-May-11 22:53 
Questionadd menu item Pin
john563214-May-11 16:05
john563214-May-11 16:05 
QuestionRe: add menu item Pin
Mark Salsbery14-May-11 16:20
Mark Salsbery14-May-11 16:20 
AnswerRe: add menu item Pin
Richard MacCutchan14-May-11 21:23
mveRichard MacCutchan14-May-11 21:23 
AnswerRe: add menu item Pin
Alain Rist14-May-11 22:02
Alain Rist14-May-11 22:02 
QuestionWho calls main() Pin
Pranit Kothari13-May-11 22:53
Pranit Kothari13-May-11 22:53 
AnswerRe: Who calls main() Pin
Paul Michalik14-May-11 0:42
Paul Michalik14-May-11 0:42 
AnswerRe: Who calls main() Pin
Luc Pattyn14-May-11 2:42
sitebuilderLuc Pattyn14-May-11 2:42 
GeneralRe: Who calls main() Pin
Richard MacCutchan14-May-11 2:58
mveRichard MacCutchan14-May-11 2:58 
GeneralRe: Who calls main() Pin
Luc Pattyn14-May-11 3:12
sitebuilderLuc Pattyn14-May-11 3:12 
AnswerRe: Who calls main() Pin
bob1697214-May-11 3:21
bob1697214-May-11 3:21 
QuestionBasic C++ String Question Pin
AmbiguousName13-May-11 19:45
AmbiguousName13-May-11 19:45 
AnswerRe: Basic C++ String Question Pin
Graham Breach13-May-11 20:49
Graham Breach13-May-11 20:49 
GeneralRe: Basic C++ String Question Pin
Stefan_Lang16-May-11 3:15
Stefan_Lang16-May-11 3:15 
GeneralRe: Basic C++ String Question Pin
Craig Longman18-May-11 5:56
Craig Longman18-May-11 5:56 
GeneralRe: Basic C++ String Question Pin
Stefan_Lang18-May-11 6:05
Stefan_Lang18-May-11 6:05 
AnswerRe: Basic C++ String Question Pin
Stefan_Lang16-May-11 3:30
Stefan_Lang16-May-11 3:30 

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.