Click here to Skip to main content
15,905,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problems creating dialog with custom control Pin
David Crow21-Aug-03 9:53
David Crow21-Aug-03 9:53 
GeneralRe: Problems creating dialog with custom control Pin
bt-ascona21-Aug-03 17:14
bt-ascona21-Aug-03 17:14 
GeneralHelp with Communicating with additional PC's Pin
21-Aug-03 5:14
suss21-Aug-03 5:14 
GeneralRe: Help with Communicating with additional PC's Pin
tmangan21-Aug-03 7:36
tmangan21-Aug-03 7:36 
GeneralCTabCtrl Pin
Gagnon Claude21-Aug-03 5:02
Gagnon Claude21-Aug-03 5:02 
GeneralRe: CTabCtrl Pin
valikac21-Aug-03 5:10
valikac21-Aug-03 5:10 
GeneralRe: CTabCtrl Pin
peterchen21-Aug-03 5:42
peterchen21-Aug-03 5:42 
GeneralRe: CTabCtrl Pin
DiWa21-Aug-03 6:08
DiWa21-Aug-03 6:08 
Hi Claude,
I use this code to activate a page:

int
CDlgTabCtrl::SetActivePage( int iPage )
{
//Place the window top-left under the tab-control
CRect rect;
GetClientRect( &rect );
AdjustRect( FALSE, rect );
CRect rectTab;
GetWindowRect( &rectTab );
GetParent()->ScreenToClient( rectTab );
rect.top +=rectTab.top;
rect.left +=rectTab.left;

//verify parameters
if( iPage+1 > m_iPages )
{
iPage =0;
}
if( iPage < 0 )
{
iPage =m_iPages-1;
}

// get the actual page
CDlgTabPage* pPage;
pPage =(CDlgTabPage *)m_Pages.GetAt( m_iActivePage );

// deactivate it
pPage->ShowWindow( SW_HIDE );
HighlightItem( m_iActivePage, FALSE );

// get the new page
pPage =(CDlgTabPage *)m_Pages.GetAt( iPage );
//adjust the position and show it
pPage->SetWindowPos( NULL, rect.left, rect.top, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE );
pPage->m_pTabCtrl =this;
pPage->OnSetActive();
m_iActivePage =iPage;
HighlightItem( m_iActivePage, TRUE );

// set the CTabCtrl-element
SetCurSel( m_iActivePage );
SetFocus();

//OkeeDokee
return m_iActivePage;
}

Make sure to set the DS_CONTROL style to your dialog pages, makes life a lot easier...

dirk
Generalkeyframe scene detection Pin
Emiliano21-Aug-03 4:58
Emiliano21-Aug-03 4:58 
GeneralRe: keyframe scene detection Pin
Joey Bloggs21-Aug-03 21:27
Joey Bloggs21-Aug-03 21:27 
GeneralComboBox in Modal DIalog Pin
Karen030221-Aug-03 4:40
Karen030221-Aug-03 4:40 
GeneralRe: ComboBox in Modal DIalog Pin
valikac21-Aug-03 5:12
valikac21-Aug-03 5:12 
Generalautomate excel copy and paste Pin
Anonymous21-Aug-03 4:40
Anonymous21-Aug-03 4:40 
GeneralRe: automate excel copy and paste Pin
David Crow21-Aug-03 7:13
David Crow21-Aug-03 7:13 
GeneralRe: automate excel copy and paste Pin
Jason Truong25-Aug-03 3:36
Jason Truong25-Aug-03 3:36 
QuestionVery strange bug - conflict between file IO and list?? Pin
Kuniva21-Aug-03 4:38
Kuniva21-Aug-03 4:38 
QuestionWhy toolbar created by CreateExdo not creates tool-tips? Pin
vgrigor21-Aug-03 4:36
vgrigor21-Aug-03 4:36 
GeneralRich Edit box (no MFC) Pin
Kayembi21-Aug-03 4:25
Kayembi21-Aug-03 4:25 
GeneralRe: Rich Edit box (no MFC) Pin
Ryan Binns21-Aug-03 4:55
Ryan Binns21-Aug-03 4:55 
GeneralRe: Rich Edit box (no MFC) Pin
Kayembi21-Aug-03 7:14
Kayembi21-Aug-03 7:14 
GeneralRe: Rich Edit box (no MFC) Pin
Ryan Binns21-Aug-03 16:48
Ryan Binns21-Aug-03 16:48 
GeneralWH_MSGFILTER Windows Hook Pin
Member 43620221-Aug-03 4:12
Member 43620221-Aug-03 4:12 
Generalmapping enum -> name Pin
peterchen21-Aug-03 3:59
peterchen21-Aug-03 3:59 
GeneralRe: mapping enum -&gt; name Pin
valikac21-Aug-03 5:15
valikac21-Aug-03 5:15 
GeneralRe: mapping enum -&gt; name Pin
peterchen21-Aug-03 5:33
peterchen21-Aug-03 5:33 

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.