积极答复者
如何在Visual C++ 2010中用Win API 建立 TabControl 页面

问题
答案
全部回复
-
HWND hTab = CreateWindowEx(0, WC_TABCONTROL, 0, TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE | TCS_VERTICAL | TCS_MULTILINE , rc.left + 2, rc.top + 2, rc.right - 4, rc.bottom - 4, hWnd, (HMENU)IDC_TAB, g_hInst, 0); TCITEM ti = {0}; ti.mask = TCIF_TEXT; TCHAR szText[MAX_PATH] = {0}; ti.cchTextMax = _countof(szText); ti.pszText = szText; for(UINT i = 0; i != 3; ++i) { StringCchPrintf(szText, _countof(szText), _T("Item %d"), i+1); TabCtrl_InsertItem(hTab, i, &ti); }
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.