Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Autocomplete Pin
progman7-May-03 3:50
progman7-May-03 3:50 
GeneralRe: Autocomplete Pin
David Crow7-May-03 4:28
David Crow7-May-03 4:28 
GeneralHWND and long Pin
Poul Haahr Klemmensen7-May-03 1:15
Poul Haahr Klemmensen7-May-03 1:15 
GeneralRe: HWND and long Pin
Neville Franks7-May-03 2:16
Neville Franks7-May-03 2:16 
GeneralRe: HWND and long Pin
Nitron7-May-03 3:17
Nitron7-May-03 3:17 
GeneralRe: HWND and long Pin
Carlos Antollini7-May-03 4:25
Carlos Antollini7-May-03 4:25 
GeneralRe: HWND and long Pin
Neville Franks7-May-03 11:12
Neville Franks7-May-03 11:12 
GeneralChild dialog in a tab control, works but not the buttons in it Pin
kallareka7-May-03 0:24
kallareka7-May-03 0:24 
I'm using a tab control that will contain several different dialogues. The tab control works fine and all the dialogues show up nicely but none of the buttons in the dialogues work...

Just to test i want the button to popup a Messagebox to check that it works. I've tried alot of stuff like using DoModal and calling a function from the parent window but that doesnt work either.

So now im asking if anyone else has used a tab control with child windows as tab pages. And if so maby they know were i've made mistakes

The tabs a added to a CObArray called m_oaTab:
CDialog* temp1 = new CDialog;
temp1->Create(IDD_DIALOG1, &m_tabben);
m_oaTab.Add(temp1);
CDialog* temp2 = new CDialog;
temp2->Create(IDD_DIALOG2, &m_tabben);
m_oaTab.Add(temp2);
CDialog* temp3 = new CDialog;
temp3->Create(IDD_DIALOG3, &m_tabben);
m_oaTab.Add(temp3);

//m_tabben is the CTabCtrl variable
m_tabben.InsertItem(0, "Tab nummer 1");
m_tabben.InsertItem(1, "Tab nummer 2");
m_tabben.InsertItem(2, "Tab nummer 3");


m_uiLastDlg1 = 0;

NMHDR pNMHDR;
long uiRes;
pNMHDR.idFrom = IDC_TAB1;
OnSelchangeTab1(&pNMHDR, &uiRes);


And here is the OnSelChangeTab1 method
void CTabbarDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
UINT uiCurDlg;
WINDOWPLACEMENT winp;
CRect rect;
m_tabben.GetWindowPlacement(&winp);m_tabben.GetWindowRect(&rect);
winp.rcNormalPosition.top = 25;
winp.rcNormalPosition.left = 5;
winp.rcNormalPosition.bottom = rect.Height() -5;
winp.rcNormalPosition.right = rect.Width() - 5;

uiCurDlg = m_tabben.GetCurSel();
((CDialog*)m_oaTab[uiCurDlg])->SetWindowPlacement(&winp);
((CDialog*)m_oaTab[m_uiLastDlg1])->ShowWindow(FALSE);
((CDialog*)m_oaTab[uiCurDlg])->ShowWindow(TRUE);
m_uiLastDlg1 = uiCurDlg;

*pResult = 0;
}


I know its not to easy to look at someone elses code and try to find faults (or perhaps it is in my case Smile | :) ) but maby you know what mistakes people "usually" do

thanx

/Eric


GeneralRe: Child dialog in a tab control, works but not the buttons in it Pin
Joan M7-May-03 3:06
professionalJoan M7-May-03 3:06 
GeneralRe: Child dialog in a tab control, works but not the buttons in it Pin
kallareka7-May-03 3:55
kallareka7-May-03 3:55 
GeneralRe: Child dialog in a tab control, works but not the buttons in it Pin
Joan M7-May-03 4:06
professionalJoan M7-May-03 4:06 
GeneralRe: Child dialog in a tab control, works but not the buttons in it Pin
kallareka7-May-03 4:32
kallareka7-May-03 4:32 
GeneralCompilation in add-in Pin
calgonit7-May-03 0:16
calgonit7-May-03 0:16 
Generalfile dialog history Pin
Tibor Blazko6-May-03 23:54
Tibor Blazko6-May-03 23:54 
GeneralRe: file dialog history Pin
Rage7-May-03 0:41
professionalRage7-May-03 0:41 
GeneralRe: file dialog history Pin
Tibor Blazko7-May-03 2:48
Tibor Blazko7-May-03 2:48 
GeneralRe: file dialog history Pin
David Crow7-May-03 3:42
David Crow7-May-03 3:42 
GeneralRe: file dialog history Pin
Tibor Blazko7-May-03 3:50
Tibor Blazko7-May-03 3:50 
GeneralRe: file dialog history Pin
David Crow7-May-03 4:34
David Crow7-May-03 4:34 
GeneralRe: file dialog history Pin
Tibor Blazko8-May-03 20:09
Tibor Blazko8-May-03 20:09 
GeneralHelp .!!! Pin
Renjith Ramachandran6-May-03 23:40
Renjith Ramachandran6-May-03 23:40 
GeneralRe: Help .!!! Pin
jmkhael7-May-03 3:03
jmkhael7-May-03 3:03 
GeneralRe: Help .!!! Pin
Renjith Ramachandran7-May-03 3:17
Renjith Ramachandran7-May-03 3:17 
GeneralRe: Help .!!! Pin
jmkhael7-May-03 3:51
jmkhael7-May-03 3:51 
GeneralRe: Help .!!! Pin
Renjith Ramachandran7-May-03 4:07
Renjith Ramachandran7-May-03 4:07 

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.