Hello guys

I've got a general question about a Button on a form... ' <<Backward' the function for this button is to go through the CList and display the contenets at that position in the screen. Anyway at the minute ive got a message box saying ' Reached beginning of list / end of list'. I wanting to go one step further and disable the button if the list is at the beginning or end. Can anyone point me in the right direction? I've tried google and not much use.

Thanks guys

Recommended Answers

All 3 Replies

assume you used ClassWizard to name the button control m_ctrlButton,

m_ctrlButton.EnableWindow(FALSE); // grey (disable) the button

assume you used ClassWizard to name the button control m_ctrlButton,

m_ctrlButton.EnableWindow(FALSE); // grey (disable) the button

where would that code go?

I didnt use a wizard instead i built the button using the Toolbox. The button is called .. 'IDC_Pervious' I've attched an event handler to the button which is resonpsible for going through the List.

This code is in the CDialog class that contains the button.

CWnd* pWnd = (CWnd*)GetDlgItem(IDC_Pervious);
pWnd->EnableWindow(FALSE);

I cannot access the link you posted from where I am at. You might want to zip up the file and attach the zip file to your post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.