Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - Tab Control -- visible confusion
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tab Control -- visible confusion

 Post Reply Post Reply
Author
Message
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Topic: Tab Control -- visible confusion
    Posted: 28 November 2009 at 6:57am
I am using the Tab Control and getting unexpected results, so I have worked out what is happening.

If I put controls (eg textbox or label) onto a Tab Control (not using the separate TabPage control),
then when I switch to a different Tab page those controls are not visible (as expected).

If I read the .LEFT of those controls I find they have changed to  .Left - 70000.
ie the Tab control has hidden them off screen by altering the .Left position.
That's OK (though I wish I'd known about it).

Problem is when I set one of those controls to  .Visible = False  when I am on a different Tab page.
When I change to the Tab page where the control is located, the Tab control makes the control visible again.
If I read the .Visible it has been changed to True.

Another problem. If I put a Line control on a Tab page, this remains visible on ALL the Tab Pages.
(I guess this is because the Line doesn't have a .Left property, so Tab cannot hide it).


I am sure I can find workarounds for all these little quirks, but first I am asking you if there is some common easy answer that I have missed. What do YOU do about these problems (or am I the only one to have noticed :-)
 



Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2009 at 6:37pm
TabControl isn't a TRUE container (like as TabStrip control) therefore, when you activate a different tab, controls will move to negative position
, to simulate Tab page behavior. Also, TabControl must set Visible=False to skip Tab key action, otherwise the user don't see really what control has Focus.
 
It's much better to use a TabPage as container ( for each Tab ) so TabControl must move only one control at time (TabPage) instead to move all controls for this Tab. This improve performances, of course.
 
In this way you avoid problem with Visible property, because TabControl set Visible=False only for TabPage, NOT for controls contained, so you can set control propreties as you want.
 
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 30 November 2009 at 5:32pm
Many thanks. That was a very helpful answer.

Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
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.188 seconds.