Click here to Skip to main content
15,911,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Code example!! Pin
David Crow3-Jun-05 2:22
David Crow3-Jun-05 2:22 
GeneralRe: Code example!! Pin
Hachaso3-Jun-05 2:45
Hachaso3-Jun-05 2:45 
GeneralRe: Code example!! Pin
sunit53-Jun-05 3:37
sunit53-Jun-05 3:37 
GeneralRe: Code example!! Pin
eli150219793-Jun-05 5:42
eli150219793-Jun-05 5:42 
GeneralRe: Code example!! Pin
Hachaso6-Jun-05 23:02
Hachaso6-Jun-05 23:02 
GeneralRe: Code example!! Pin
David Crow7-Jun-05 2:53
David Crow7-Jun-05 2:53 
GeneralCEdit control Validation Pin
laiju3-Jun-05 1:23
laiju3-Jun-05 1:23 
GeneralRe: CEdit control Validation Pin
David Crow3-Jun-05 2:30
David Crow3-Jun-05 2:30 
DDV_MinMaxInt() only validates when the OK button is clicked. I find it better to not enable the OK button until all requirements have been met. Something like:

// the OK button starts off as disabled
 
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
    //{{AFX_MSG_MAP(CMyDlg)
    ON_EN_CHANGE(IDC_EDIT1, UpdateControls)
    ON_EN_CHANGE(IDC_EDIT2, UpdateControls)
    ON_EN_CHANGE(IDC_EDIT3, UpdateControls)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()
 
void CMyDlg::UpdateControls( void ) 
{
    bool bEnable = true;
 
    // all three edit controls must be non-empty
    bEnable &= (m_edit1.GetWindowTextLength() > 0);
    bEnable &= (m_edit2.GetWindowTextLength() > 0);
    bEnable &= (m_edit3.GetWindowTextLength() > 0);
 
    // the third edit control must be within range
    CString str;
    m_edit3.GetWindowText(str);
    bEnable &= (atoi(str) >= 0 && atoi(str) <= 200);
 
    m_btnOK.EnableWindow(bEnable);
}



"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown


GeneralRe: CEdit control Validation Pin
laiju3-Jun-05 3:57
laiju3-Jun-05 3:57 
GeneralDHCP client Implementation on WindowsXP Pin
Le Hong Anh3-Jun-05 1:08
Le Hong Anh3-Jun-05 1:08 
GeneralRTP &amp; RTCP implementation in C++ Pin
voipdjfzh3-Jun-05 1:02
voipdjfzh3-Jun-05 1:02 
GeneralInterrogating clipboard contents Pin
Alton Williams3-Jun-05 0:32
Alton Williams3-Jun-05 0:32 
GeneralRe: Interrogating clipboard contents Pin
Ravi Bhavnani3-Jun-05 2:03
professionalRavi Bhavnani3-Jun-05 2:03 
GeneralRe: Interrogating clipboard contents Pin
ThatsAlok3-Jun-05 2:11
ThatsAlok3-Jun-05 2:11 
GeneralNeed an Algorithm Pin
P-Rex3-Jun-05 0:02
P-Rex3-Jun-05 0:02 
GeneralRe: Need an Algorithm Pin
Cedric Moonen3-Jun-05 0:16
Cedric Moonen3-Jun-05 0:16 
GeneralRe: Need an Algorithm Pin
toxcct3-Jun-05 0:21
toxcct3-Jun-05 0:21 
GeneralRe: Need an Algorithm Pin
Cedric Moonen3-Jun-05 1:17
Cedric Moonen3-Jun-05 1:17 
GeneralRe: Need an Algorithm Pin
camoguard3-Jun-05 4:05
camoguard3-Jun-05 4:05 
GeneralRe: Need an Algorithm Pin
Andrew Kirillov3-Jun-05 0:29
Andrew Kirillov3-Jun-05 0:29 
GeneralRe: Need an Algorithm Pin
P-Rex3-Jun-05 1:23
P-Rex3-Jun-05 1:23 
GeneralRe: Need an Algorithm Pin
Tim Smith3-Jun-05 3:43
Tim Smith3-Jun-05 3:43 
GeneralRe: Need an Algorithm Pin
toxcct3-Jun-05 0:33
toxcct3-Jun-05 0:33 
GeneralRe: Need an Algorithm Pin
Blake Miller3-Jun-05 4:03
Blake Miller3-Jun-05 4:03 
GeneralRe: Need an Algorithm Pin
toxcct3-Jun-05 4:05
toxcct3-Jun-05 4:05 

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.