News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Tab Control Problem

Started by halsten, May 04, 2008, 01:25:07 PM

Previous topic - Next topic

halsten

I am creating a a form with a tab control, however am having problems navigating through the tabs. I attached the test form for others to check.

DMac

There are two things that are causing problems:

1. The handles need to be static or global

2. Notify needs to be more specific:



case WM_NOTIFY:

if(hTab == ((LPNMHDR)lParam)->hwndFrom &&
TCN_SELCHANGE == ((LPNMHDR)lParam)->code)
{
dwlResult = SendMessage(hTab, TCM_GETCURSEL, 0, 0);

switch (dwlResult) {
case 0:
hwndTabHandle = hDlgLog;
break;

case 1:
hwndTabHandle = hDlgInformation;
break;

case 2:
hwndTabHandle = hDlgProtection;
break;

case 3:
hwndTabHandle = hDlgAdvancedProtection;
break;
}

ShowWindow(PrevSelTab, SW_HIDE);
ShowWindow(hwndTabHandle, SW_SHOW);

PrevSelTab = hwndTabHandle;

    return TRUE;
}
No one cares how much you know,
until they know how much you care.