Click here to Skip to main content
15,890,946 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SetItemText() Problem Pin
Rage18-Aug-06 2:25
professionalRage18-Aug-06 2:25 
GeneralRe: SetItemText() Problem Pin
Maximilien18-Aug-06 2:30
Maximilien18-Aug-06 2:30 
GeneralRe: SetItemText() Problem Pin
Rage18-Aug-06 3:33
professionalRage18-Aug-06 3:33 
GeneralRe: SetItemText() Problem Pin
Hamid_RT18-Aug-06 3:00
Hamid_RT18-Aug-06 3:00 
QuestionRe: SetItemText() Problem Pin
David Crow18-Aug-06 3:16
David Crow18-Aug-06 3:16 
QuestionRe: SetItemText() Problem Pin
prasad_som18-Aug-06 3:19
prasad_som18-Aug-06 3:19 
AnswerRe: SetItemText() Problem Pin
Kiran Pinjala18-Aug-06 3:26
Kiran Pinjala18-Aug-06 3:26 
QuestionOnCancel Pin
SandhyaSri18-Aug-06 1:35
SandhyaSri18-Aug-06 1:35 
Hi I have two edit controls , 1 OK button and 1 Cancel Button.The code for the first editbox's EN_KILLFOCUS event is as follows:
void CTrial1Dlg::OnKillfocusEdit1()
{
// TODO: Add your control notification handler code here
CEdit *pEdit;
CString str;
double d1;
GetDlgItemText(IDC_EDIT1,str);
if(str.CompareNoCase(_T(""))!=0)
{
d1=_tcstod(str,NULL);
if(d1 > 3)
{
AfxMessageBox(_T("Greater than 3.Enter less than 3"));
pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
pEdit->SetFocus();
}

}
}
when I enter a number greater than 3 the message is displayed.As long as I press "OK" the message will be raised.The message will be raised even if I press "OnCancel".
My requirement is when the message is displayed and if I press the "Cancel" button the dialog should end.As I am using setfocus(), how can I do this?
Thanks in advance.

Sandhya

AnswerRe: OnCancel Pin
Cedric Moonen18-Aug-06 1:48
Cedric Moonen18-Aug-06 1:48 
GeneralRe: OnCancel Pin
SandhyaSri18-Aug-06 1:57
SandhyaSri18-Aug-06 1:57 
GeneralRe: OnCancel Pin
Cedric Moonen18-Aug-06 2:20
Cedric Moonen18-Aug-06 2:20 
AnswerRe: OnCancel Pin
David Crow18-Aug-06 3:08
David Crow18-Aug-06 3:08 
Questionwinsock errors Pin
afpr18-Aug-06 1:20
afpr18-Aug-06 1:20 
AnswerRe: winsock errors Pin
Rage18-Aug-06 1:27
professionalRage18-Aug-06 1:27 
GeneralRe: winsock errors Pin
afpr18-Aug-06 3:21
afpr18-Aug-06 3:21 
GeneralRe: winsock errors Pin
Rage18-Aug-06 3:30
professionalRage18-Aug-06 3:30 
QuestionDraw on Dialog Pin
erikamania18-Aug-06 1:04
erikamania18-Aug-06 1:04 
AnswerRe: Draw on Dialog Pin
Cedric Moonen18-Aug-06 1:10
Cedric Moonen18-Aug-06 1:10 
AnswerRe: Draw on Dialog Pin
Prakash Nadar18-Aug-06 1:19
Prakash Nadar18-Aug-06 1:19 
AnswerRe: Draw on Dialog [modified] Pin
_AnsHUMAN_ 18-Aug-06 1:35
_AnsHUMAN_ 18-Aug-06 1:35 
AnswerRe: Draw on Dialog Pin
Hamid_RT18-Aug-06 2:46
Hamid_RT18-Aug-06 2:46 
QuestionAbout CView problem,thank:) Pin
rxgmoral18-Aug-06 1:03
rxgmoral18-Aug-06 1:03 
AnswerRe: About CView problem,thank:) Pin
Rage18-Aug-06 1:28
professionalRage18-Aug-06 1:28 
QuestionRe: About CView problem,thank:) Pin
David Crow18-Aug-06 3:18
David Crow18-Aug-06 3:18 
Questionusing dll in VB(please help) Pin
aaaan18-Aug-06 0:59
aaaan18-Aug-06 0:59 

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.