Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSTab Question 4

Status
Not open for further replies.

aclayborne

Programmer
May 3, 2000
49
0
0
US
I have a textbox on tab1 if I go to tab3 and set the textbox.visible to true it shows up on tab3. Does VB not know that the textbox belongs to tab1. Is there a way to setup the textbox so that it belongs to tab1.

Acie Clayborne
 
Are you meaning to have A Control Array? Eg txtBox(1), txtBox(2), txtBox(3)? Rob
"Programming is like art...It makes me feel like chopping my ear off."
 
No, it's not in an array. During design the textbox was put on tab1 and when I'm on tab3 executing code and I set textbox.visible to true it appears on tab3.
 
What do you mean by on tab1 and on tab3? Are these names of controls on your form? Or are you refering to key presses? Rob
"Programming is like art...It makes me feel like chopping my ear off."
 
Did you draw the textbox on the form and then drag it to the tab control, or, did you draw it on the tab control itself? This makes a difference.
 
Ah, the tab control...sounds like shavon may have solved your problem though ;) Rob
"Programming is like art...It makes me feel like chopping my ear off."
 
Tab1 and Tab3 refers to sstab1.tab = 1 or sstab1.tab = 3.
 
This is an application that I've taken over so I'm not sure if they were drawn or dragged on to the form. What are the differences between the two?
 
If your textbox was drawn on the form and then dragged onto the tab the control could make it available to all. If you draw it on that tab it sould become part of only that tab. I have noticed problems with this and it depends on what service pack you are running. I have had the least problems with sp4.
 
if you drag it to the sstab it will still be a child of the Form1....not a child of the sstab...you have to plop it inside the sstab for VB to write the code letting it know that it's a child of sstab ;) Rob
"Programming is like art...It makes me feel like chopping my ear off."
 
You CAN change containers at run-time.
In the Form_Load event
Set textbox.container = tab3.

Also, redraw is not necessary. Right-click on the control, select CUT, left-click on the tab, right-click on the tab and select PASTE.
 
Yes, John's right, you can cut and paste it...sorry forgot to mention that, thanks John ;) Rob
"Programming is like art...It makes me feel like chopping my ear off."
 
I think John's suggestion to use the textbox.container quite helpfull especially when using tabs. So worth a vote!

Herman :-Q
 
Well, like they say in the old movies, "thanks fellas."
BTW, if I have a control/frame that I will need in one place or another e.g. Personal/Business frame, I put a visible=false label at design-time at the locations where the control/frame is to go at run-time then use the "marker" label's data container, left and top values.
With lblBusnAddr
Set fraAddress.Container = .Container
fraAddress.Move .left, .top
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top