Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - TabControl close button problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TabControl close button problem

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


Joined: 24 February 2006
Location: United Kingdom
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote preecep Quote  Post ReplyReply Direct Link To This Post Topic: TabControl close button problem
    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

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: 24 February 2006 at 8:34am

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

try this sample:

2006-02-24_083420_Sa.zip

Do you see problem with it with 9.70 release?

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
preecep View Drop Down
Newbie
Newbie


Joined: 24 February 2006
Location: United Kingdom
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote preecep Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
preecep View Drop Down
Newbie
Newbie


Joined: 24 February 2006
Location: United Kingdom
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote preecep Quote  Post ReplyReply Direct Link To This Post 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: 2006-02-24_101312_Sa.zip

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: 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
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: 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
Back to Top
preecep View Drop Down
Newbie
Newbie


Joined: 24 February 2006
Location: United Kingdom
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote preecep Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2006 at 10:53am

workaround worked fine.

thanks.

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.203 seconds.