Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to find out the Tab to which a control belongs?

Posted on 1999-07-28
19
Medium Priority
?
202 Views
Last Modified: 2013-12-25
I have a SSTab Control on my form. I have 2 Tab Pages in this control. Each page has different controls (like text boxes, combo boxes etc). How can I find which control (text box) is placed on which page of the SSTab control, at run time.
Please help.

thanks,
alok
0
Comment
Question by:alokanant
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +6
19 Comments
 
LVL 3

Expert Comment

by:Gunsen
ID: 1495675
I do not know of any property which can determine the active Tab page.
But why don't you flag each control using the TAG property and set it to corresponding tab-page (SSTab1.Tab). Or do you create those dynamically?
0
 
LVL 2

Author Comment

by:alokanant
ID: 1495676
Dear Gunsen,

Thanks for answering, but i have already used the tag property of the controls for some other purpose. is there some other way?

alok.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 1495677
Inside each tab, I place a frame whose name end by the tab number and which the border property is set to none.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:caraf_g
ID: 1495678
Absolutely. And stick the controls on to that frame. You can then query the controls' Parent to find out on which frame they are sitting, and then use that to determine which tab you must be on.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1495679
???? Just look at the SStab1.tab property and you'll get your tab number.

M

0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1495680
mark2150 - The SSTab is not a container control. So given a control you cannot find out what tab it "belongs" to. That was the question...
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1495681
Oh, sorry, please reject.

M

0
 
LVL 2

Author Comment

by:alokanant
ID: 1495682
Dear caraf_g and emoreau,

thanks for your comments.
i was thinking of the same thing. But is there anything new in VB 6 which could do the job directly? I am presently using VB 5. Also, I tried using the container property of the textbox control, although this returns the SSTab control, but it doesn't return the page which contains the control. Any ideas on that?

alok.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1495683
I'm afraid there isn't anything new.

WRT using SSTab as a container - don't. It causes lots of problems. So revert back to emoreau's idea.

Make sure all the frames are positioned in front of the SSTab, but not as a child of the SSTab. In other words, when you move the SSTab and the frame so that they overlap, the frame should be in front of the SSTab. Then position the frame(s) so that it (they) are positioned so that they look as if they are on the SSTab - the user won't know any different... Then use the .visible property of the frames to show the correct one according to what tab was taken on the SSTab.
0
 

Expert Comment

by:micwong
ID: 1495684
Technically, I don't know which attributes or controls can help you. But, did you think that you can use the control name to distinish them?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1495685
You can determine if a control is located on the current tab.
Take a look at the left property. If it is between -75000 and 0. The control is not on the current tab
0
 
LVL 8

Expert Comment

by:vettranger
ID: 1495686
I've used SSTab as a container for some time with no problems.

I'm interested in what problems some of you might have had with it.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1495687
Mostly problems with controls not repainting properly, but I gave up on using SSTab as a container so long ago now that I don't really remember :)
0
 
LVL 2

Author Comment

by:alokanant
ID: 1495688
hi caraf_g,

how do we use sstab as a container, is this same as making the frames as child of SSTab control, i.e. each Tab will act as parent of the frame in it.


0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1495689
No, that's the problem. The control as a whole will be the container for your controls, not each individual tab. That's why you are better off using the frames as containers. And then, since you're at it, don't use the SSTab as the containter control for your frames as all but just stick it behind the frames!
0
 
LVL 1

Expert Comment

by:vbplus
ID: 1495690
Hi,

Adding to what caraf_g is saying, why dont you use the TabStrip instead. It is supposed to work this way (with frames holding the controls and the manipulation of the Visible property).
0
 
LVL 2

Author Comment

by:alokanant
ID: 1495691
hi caraf_g,

thanks for your replys. what should i do if i want to give the points to u.
0
 
LVL 10

Accepted Solution

by:
caraf_g earned 40 total points
ID: 1495692
Just invite me to put any answer to this question. I'll consider myself invited then ;-)

(PS - if you don't want to give the points to me, just reject this answer)
0
 
LVL 2

Author Comment

by:alokanant
ID: 1495693
thanks a lot.

alok.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question