Print Page | Close Window

TabControl close button problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3700
Printed Date: 17 November 2024 at 9:49am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TabControl close button problem
Posted By: preecep
Subject: TabControl close button problem
Date Posted: 24 February 2006 at 6:14am

When creating TabControl tabs using InsertItem, I set .Closeable to false but the far right 'x' close button on the tab control is still displayed. When I click on a different tab and back again the close button disappears.

As the TabControl does not raise a closing event it is critical that I stop this button from appearing and it seems .Closeable is bugged.

Any ideas ?

9.70 btw




Replies:
Posted By: Oleg
Date Posted: 24 February 2006 at 8:34am

Can't reproduce it with 9.81, may be it was fixed already

try this sample:

https://forum.codejock.com/uploads/oleg/2006-02-24_083420_Sa.zip - 2006-02-24_083420_Sa.zip

Do you see problem with it with 9.70 release?



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


Posted By: preecep
Date Posted: 24 February 2006 at 10:08am

After playing around with your sample I have located the problem:

If you put an item.Selected=true before the item.closeable=false then the 'x' button will show until the tab is hidden and reshown. Code as below:

Set Item = TabControl1.InsertItem(0, "Item", 0, 0)
Item.Selected = True
Item.Closeable = False

 

Moving the .Selected after the .Closeable fixes the problem.



Posted By: preecep
Date Posted: 24 February 2006 at 10:11am

And after some more testing you cannot stop the first tab from being closeable if it is the only tab.

Dim Item As TabControlItem
Set Item = TabControl1.InsertItem(0, "Item", 0, 0)
Item.Closeable = False

produces a single tab with a close button!

Attached project: https://forum.codejock.com/uploads/preecep/2006-02-24_101312_Sa.zip - 2006-02-24_101312_Sa.zip



Posted By: Oleg
Date Posted: 24 February 2006 at 10:27am

Yes, seems the bug with only one item :(  Will fix it for next releasea

But for one item you always can hide close button with:

TabControl1.ShowNavigateButton xtpTabNavigateButtonClose, xtpTabNavigateButtonNone

 

Thank you



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


Posted By: Oleg
Date Posted: 24 February 2006 at 10:36am

The problem was because TabControl not refreshed after Closable property changed.

As another workaround you can resize it a little to reposition elements of TabControl:

TabControl1.Width = TabControl1.Width + 100

 

Fixed for next release.



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


Posted By: preecep
Date Posted: 24 February 2006 at 10:53am

workaround worked fine.

thanks.




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