Print Page | Close Window

'X' on a tab control?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5385
Printed Date: 29 April 2024 at 3:45am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: 'X' on a tab control?
Posted By: ContactGT
Subject: 'X' on a tab control?
Date 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).



Replies:
Posted By: Oleg
Date Posted: 30 October 2006 at 2:35pm

Hello,

try
 
tc.FindNavigateButton(xtpTabNavigateButtonClose)->SetFlags(xtpTabNavigateButtonAlways);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ContactGT
Date 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()



Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net