I got MFC CTab control in the dialog. It is inserted using resource editor, and bunch of other controls are pasted onto it.
In the OnInitDialog() function tab is extended like this:
I got MFC CTab control in the dialog. It is inserted using resource editor, and bunch of other controls are pasted onto it.
In the OnInitDialog() function tab is extended like this:
CTabCtrl question!
cyr2224
Yes you need to use TCITEM struct. And this is faster and better than your code.
HsiaoI
This notification is well documented:
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/tab/notifications/tcn_selchange.asp frame=true
I directly see no problem.But why do you delete the last item. Just use SetItem and change the text of the last item and add a new one.
Trubble
Ok, and when I try using TCITEM structure, problem of disappearing controls is not solved:
void
CMFC02Dlg::OnTcnSelchangeTab1(NMHDR *pNMHDR, LRESULT *pResult){
}
Brian26
It sure makes the code neater!
But now I got a new problem. If you can help, please try:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=256727&SiteID=1&mode=1
iAMssGOH
You can obmit the delete. This adds the new entry in front of the last one:
if (selectedTab == numberOfTabs)
{
}
SanthoshGV
Titou
Well I tried Tab.SetItem(number, "Title") with "number" containing a number of last item, but it didn't work, it just says:
cannot convert parameter 2 from 'CString *__w64 ' to 'TCITEMA *'In msdn, under "CTabCtrl" there is no "events" link and also I searched keyword "OnTcnSelchange" with no result so I thought it is not documented.
Thanx for the help with msdn!
N.Raja