Originally posted by: Matt J
Cool, thanks!
Codeguru rocks! Especially getting around all the weirdness of VC6 GUI and MFC, I can't believe how helpful this site is.
ReplyOriginally posted by: Vikram T N
The same code segment... with small changes
Overload the "OnInitdoalig()" of the PropertyPage.. and write following lines.
// Set the details of the Tab
TC_ITEM tcItem;
tcItem.mask = TCIF_TEXT;
tcItem.cchTextMax = _MAX_PATH /* Buffer */ ;
tcItem.pszText = (LPTSTR)((LPCTSTR)sCaption/*Text*/);
// Get the Tab Control and Set the Tab Properties
(CTabCtrl*)(GetTabControl())->SetItem(0 /* Page Number */, &tcItem );
This Code segment works.
ReplyOriginally posted by: Joe Ersinghaus
In my app, I want to take text from an edit control inside a property page and use this as the tab name. The code for modifying tab names works great when called from within the property sheet code, but if called from within the property page code - I crash somewhere in the bowls of MFC in "GetTabControl()->SetItem(nPage, &tcItem);"
From my property page I call this code:
CMyPropertySheet ps = (CMyPropertySheet*)GetParent();
SetTabName(CString& TempString) in the property sheet code contains:
TC_ITEM tcItem;
Anybody have an Idea why it's crashing and/or maybe a better way to do change tab names from within the property page code.
Thanks,
Hello,
UpdateData(TRUE);
m_MyEditBox.GetWindowText(TempString);
ps->SetTabName(TempString);
tcItem.mask = TCIF_TEXT;
tcItem.pszText = (LPTSTR)((LPCTSTR)TestString);
GetTabControl()->SetItem(nPage, &tcItem);
Joe
Originally posted by: Michelle Courier
instead of: "some label"
Sincerely,
Do you know of a way to format the property page title to contain multiple lines?
be able to have: "some
label"
I've tried adding the title myself in the code and using '\n' and '\r\n' in the string, but neither of these worked.
Michelle Courier
Originally posted by: Mandar
void CMainFrame::SomeMenuHandler()
....
But the app crashes in the statement, GetTabCtrl(), it fails in that function as
ASSERT(::IsWindow(m_hWnd)) fails for that property sheet......
What do I do???
I tried doing this kind of stuff in a function that was actually instantiating the propertysheet and calling
it's DoModal, as follows....
{
CMyPropertySheet ps(this);
TC_ITEM tc;
......the same code mentioned to set item label...
// My Application Specific initialization of page control data members....
}