Print Page | Close Window

Tab Control -- visible confusion

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=15739
Printed Date: 26 November 2024 at 9:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tab Control -- visible confusion
Posted By: chrisABC
Subject: Tab Control -- visible confusion
Date 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



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


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



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