Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - 'X' on a tab control?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

'X' on a tab control?

 Post Reply Post Reply
Author
Message
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Topic: 'X' on a tab control?
    Posted: 30 October 2006 at 11:27am
Is is possible to add a little 'X' button on the right hand side of a CXTPTabControl, so that the user can close the current tab? I would like this button to generate an OnClose message, which I already handly (through a right click).
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2006 at 2:35pm

Hello,

try
 
tc.FindNavigateButton(xtpTabNavigateButtonClose)->SetFlags(xtpTabNavigateButtonAlways);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2006 at 11:05am

Excellent thank you. What event do I need to capture to handle pressing of this button? It is not hitting OnClose()

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2006 at 2:58pm
Hello,
Unfortunatelly no notification, but virtual method exists:
 
override OnNavigateButtonClick. Default implementation is:
 
void CXTPTabControl::OnNavigateButtonClick(UINT nID)
{
 if (m_pSelected && (nID == xtpTabNavigateButtonClose) && m_pSelected->IsClosable())
 {
  DeleteItem(m_pSelected->GetIndex());
 }
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.