Make these controls visible, 2nd tab page |
Resume:
Details ...
// TestVC0Dlg.cpp : implementation file // ... ................................................................................................................................................ ................................................................................................................................................. ///////////////////////////////////////////////////////////////////////////// // CTestVC0Dlg message handlers BOOL CTestVC0Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // *** Initialize / declaration *** m_pDB = new CDaoDatabase; m_pRS = new CDaoRecordset(m_pDB); TCHAR curdir[MAX_PATH]; //MAX_PATH - Maximum length of directory CString Databasename; // Get Current Directory GetCurrentDirectory( MAX_PATH, curdir ); //DataBase name, KJV.mdb at Current Directory Databasename = (CString)curdir + _T("\\KJV.mdb"); m_pDB->Open(Databasename); m_pRS->Open(dbOpenDynaset, "SELECT * from BibleTable", 0); //Move to first available record m_pRS->Move(2); //Display the content of record CalculValue(); //Stiuation of controls SetButtons(TRUE); //Initialize the Tab Comtrol TC_ITEM TabCtrlItem; TabCtrlItem.mask = TCIF_TEXT; TabCtrlItem.pszText = " By word "; m_tab1.InsertItem( 0, &TabCtrlItem ); TabCtrlItem.pszText = " By address "; m_tab1.InsertItem( 1, &TabCtrlItem ); //Make these controls visible or invisible, in the Tab Control m_staticsel.ShowWindow(SW_HIDE); m_combobook.ShowWindow(SW_HIDE); m_combotitle.ShowWindow(SW_HIDE); m_combochapter.ShowWindow(SW_HIDE); m_comboverse.ShowWindow(SW_HIDE); m_staticbook.ShowWindow(SW_HIDE); m_statictitle.ShowWindow(SW_HIDE); m_staticchapter.ShowWindow(SW_HIDE); m_staticverse.ShowWindow(SW_HIDE); m_searchlist.ShowWindow(SW_SHOW); m_edwordcontrol.ShowWindow(SW_SHOW); m_display.ShowWindow(SW_SHOW); m_statictype.ShowWindow(SW_SHOW); m_staticfoundcontrol.ShowWindow(SW_SHOW); //Show the header row of List Control int strWidth1 = m_searchlist.GetStringWidth(_T("00000")); m_searchlist.InsertColumn(1, _T("Record"), LVCFMT_LEFT,2*strWidth1, 1); m_searchlist.InsertColumn(2, _T("Bk"), LVCFMT_LEFT, strWidth1, 1); m_searchlist.InsertColumn(3, _T("Title"), LVCFMT_LEFT, 4*strWidth1, 1); m_searchlist.InsertColumn(4, _T("Ch"), LVCFMT_LEFT, strWidth1, 1); m_searchlist.InsertColumn(5, _T("Verse"), LVCFMT_LEFT, 3*strWidth1/2, 1); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control } ................................................................................................................................................ ................................................................................................................................................ ... |
select the class CTestVC0Dlg. Choose Edit Code -or- Double-click the function name. The insertion point moves to the function in theTestVC0Dlg.cpp file. Edit the Text Code, examine these changes ... TestVC0Dlg.cpp file - the new Text Code is red.
|