We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Selective enabling of close button for TabPageAdv

Hi,

I am in a situation where I need to allow some pages to be closed and some to be disallowed. Currently, the tab control supports ShowTabCloseButton and ShowCloseButtonForActiveTabOnly to allow the user to close the tabs. But this is a common property that applies to all tabs. Would I be able to selectively do this?

Regards,
Shoban Jayaraj


17 Replies

AD Administrator Syncfusion Team July 28, 2008 08:51 AM UTC

Hi Shoban,

Thank you for interest in Syncfusion Products.

We regret to let you know that currently we do not provide support for this with our code library. We have notified our developers regarding this. We will update you once the feature is available.

Please let me know if any concerns.

Regards,
Hema



AD Administrator Syncfusion Team October 30, 2008 02:10 PM UTC

Perhaps this could be achieved by setting ShowCloseButtonForActiveTabOnly = true, and then selectively setting ShowTabCloseButton to true or false inside the TabControl.SelectedIndexChanging event...

That way you can only close the active tab, and the close buttons can be shown selectively depending on which tab you have open ....

A



EC emin coskun replied to Administrator November 13, 2020 05:33 PM UTC

Hi,

I am in a situation where I need to allow some pages to be closed and some to be disallowed. Currently, the tab control supports ShowTabCloseButton and ShowCloseButtonForActiveTabOnly to allow the user to close the tabs. But this is a common property that applies to all tabs. Would I be able to selectively do this?

Regards,
Shoban Jayaraj


I want to get CloseButton=false to prevent closing a specific tabpage in TabControlAdv, so there will be no closebutton on the pages I set, there will be closebutton on other tabpages, how do I ensure this vb.net I'm using it thank you

also, I want to add a new tab with the help of the tabcontroladv button, I want to add a tab tabcontrolde if it is not selected, I want it to be added

3. how to add scroll and itemlist buttons to tabcontroladv in my question syncfusion tabcontroladv I'm New thank you


BR Bharathi Rajakantham Syncfusion Team November 17, 2020 01:17 PM UTC

Hi Emim, 
 
 
Thanks for contacting Syncfusion Support, 
 
 
Query 1: I want to get CloseButton=false to prevent closing a specific tabpage in TabControlAdv. 
 
You can make use of the DrawItem and MouseDown events. The DrawItem provides access to the Graphics object which helps us to draw a Close mark on Tabs.The GetTabRect method will give the Bounds of each tab. Finally, we can check for the coresponding tab in the MouseDown event to close that Tab.Please check the kb for your reference. 
 
 
 
Query 2: I want to add a new tab with the help of the tabcontroladv button, I want to add a tab tabcontrolde if it is not selected, I want it to be added 
 
Please share more details on how you need to add tab with tabcontroladv button.if possible please provide a screenshot or video it will be helpful for us to provide a prompt solution on this. 
 
 
Query 3: how to add scroll and itemlist buttons to tabcontroladv 
 
It can  be achieved by creating the custom class and overriding the AdjustScrollButtonDimensions function in the TabControlAdv.Please check the kb for your reference. 
 
 
 
Please let us know if you need further assistance on this.We will be glad to assist you. 
 
 
Regards, 
Bharathi R 



EC emin coskun November 17, 2020 03:48 PM UTC

Thank you.I also updated version 18.3.0.35 to version 18.3.0.47 with the update I am using visual studio 2019 now neither syncfusion tools nor other tools appear in the toolbar The toolbar appears empty.I'm applying the instructions on your site, but I couldn't find a kind of solution what is the solution


EC emin coskun replied to Bharathi Rajakantham November 18, 2020 10:14 AM UTC

Hi Emim, 
 
 
Thanks for contacting Syncfusion Support, 
 
 
Query 1: I want to get CloseButton=false to prevent closing a specific tabpage in TabControlAdv. 
 
You can make use of the DrawItem and MouseDown events. The DrawItem provides access to the Graphics object which helps us to draw a Close mark on Tabs.The GetTabRect method will give the Bounds of each tab. Finally, we can check for the coresponding tab in the MouseDown event to close that Tab.Please check the kb for your reference. 
 
 
 
Query 2: I want to add a new tab with the help of the tabcontroladv button, I want to add a tab tabcontrolde if it is not selected, I want it to be added 
 
Please share more details on how you need to add tab with tabcontroladv button.if possible please provide a screenshot or video it will be helpful for us to provide a prompt solution on this. 
 
 
Query 3: how to add scroll and itemlist buttons to tabcontroladv 
 
It can  be achieved by creating the custom class and overriding the AdjustScrollButtonDimensions function in the TabControlAdv.Please check the kb for your reference. 
 
 
 
Please let us know if you need further assistance on this.We will be glad to assist you. 
 
 
Regards, 
Bharathi R 


Query 2: I want to add a new tab with the help of the tabcontroladv button, I want to add a tab tabcontrolde if it is not selected, I want it to be added 
 
Please share more details on how you need to add tab with tabcontroladv button.if possible please provide a screenshot or video it will be helpful for us to provide a prompt solution on this. 

I have three tab pages named Home Save and Save as as seen in the following pictures. Home tab, my home tab will remain fixed and CloseButton will be inactive in this tab.
When I click the button named save in the RibbonControl, the save tab will open.If this tab is open, the save tab should be selected.A new save tab, that is, a second save tab, should not be opened.
I want it to be as shown in the picture



EC emin coskun November 18, 2020 11:37 AM UTC


When the project is opened, only the Home tab will be open.


EC emin coskun November 18, 2020 11:42 AM UTC


When I press the SAVE button, the Save tab will be added to the program and the Save tab will be a CloseButton.


EC emin coskun November 18, 2020 11:46 AM UTC


When I press the SAVE AS button, the Save As tab will be added to the program and the Save As tab will be a CloseButton.


EC emin coskun November 18, 2020 11:51 AM UTC

When I press the SAVE or SAVE AS buttons, if the Save or Save As tabs are previously open in TabControl, the new tab will not be added, the tab to be added will become selected.Thank you.





BR Bharathi Rajakantham Syncfusion Team November 18, 2020 12:58 PM UTC

Hi Emim, 
 
Thanks for your update, 
 
Query 1: Toolbar appears empty 
 
We suspect that you are facing an issue in toolbox and the controls were not loaded in it.Please check the documentation link for your reference. 
 
 
Please try the above solution if it not satisfies your requirement please share us more details on it.If possible please share the issue reproducing video and the screenshot it will be helpful for us to provide a prompt solution on this. 
 
 
Query 2:  I want to add a new tab with the help of the tabcontroladv button, I want to add a tab tabcontrolde if it is not selected, I want it to be added  
 
 
We are checking the reported query from our side we will update you the further details on 19th Nov 2020. 
 
 
Regards, 
Bharathi R 



EC emin coskun November 18, 2020 04:32 PM UTC

thank you  Bharathi Rajakantham. I explained what I want to do with the pictures above, I would be glad if you could help. 


EC emin coskun November 18, 2020 05:19 PM UTC

thank you Bharathi Rajakantham. Visual studio or syncfusion has been installed, but the codes in the link you provided give wrong errors. The codes in the DrainItem and MouseDown events are incorrect. I showed what I wanted in the pictures above.


BR Bharathi Rajakantham Syncfusion Team November 19, 2020 03:36 PM UTC

Hi Emim, 
 
Thanks for your update, 
 
We have checked your query “ I want to add a new tab with the help of the tabcontroladv button, I want to add a tab tabcontrolde if it is not selected, I want it to be added”.We have prepared a simple sample achieving your requirement you need to set the ShowTabCloseButton and showCloseButtonForActiveTabOnly property as true and added the newtab on buttonclick if the tab is not added in the TabControlAdv.Please check the sample for your reference. 
 
 
 
Please try the given solution and  let us know if you need any further assistance on this.We will be glad to assist you. 
 
Regards, 
Bharathi R 



EC emin coskun November 20, 2020 04:49 PM UTC

thank you .Type TabControlAdv1.TabPrimitivesHost.TabPrimitives (Syncfusion.Windows.Forms.Tools.TabPrimitiveType.DropDown) .Visible = False on your version 18.3.0.47 turns close = false TabControlAdv1.TabPrimitivesHost.TabPrimitives (Syncfusion.Windows.Forms.Tools.TabPrimitiveType.Close) .Visible = False drops DropDown = false I think there is an error in your version 18.3.0.47, you can see if you check thanks


BR Bharathi Rajakantham Syncfusion Team November 24, 2020 02:10 AM UTC

Hi Emim, 
 
Thanks for your update, 
 
We are checking the reported query from our side and will update you the further details on 25th November 2020. Please let us know if you need any further assistance on this.We will be glad to assist you. 
 
Regards, 
Bharathi R 



BR Bharathi Rajakantham Syncfusion Team November 25, 2020 01:44 PM UTC

Hi Emim, 
 
 
Thanks for your Patience, 
 
 
We have checked your query with simple sample by setting the tabcontrol dropdown visibility as false and true and it is working properly for us in the 18.3.0.47 Version.Please check the sample and the video for your reference. 
 
 
 
 
 
 
Please ensure the sample and video and  confirm us whether our replication procedure is same as yours.If not please provide us the issue reproducing sample and the video it will be helpful for us to provide a prompt solution on this. 
 
Regards, 
Bharathi R 


Loader.
Live Chat Icon For mobile
Up arrow icon