PDA

Click to See Complete Forum and Search --> : Tabstrips


StudentProgrammer
Jan 19th, 2000, 09:45 AM
I'm using a tabstrip to display help info for my program. How do I get the text in a textbox on the tabstrip to show different text when you change the tab. (the VB help file doesn't really explain things too well as you all probably know and it is also somewhat criptic)

Thanks.

PS I'm using VB4

DiGiTaIErRoR
Jan 19th, 2000, 10:11 AM
use the click event

------------------
DiGiTaIErRoR

StudentProgrammer
Jan 19th, 2000, 10:15 AM
Please excuse my ignorance with tabstrips, but as far as I can see there is only one click even for the whole set of tabs (I have 3), how do I differentiate between clicking on one tab and the other?

StudentProgrammer
Jan 19th, 2000, 10:27 AM
Thank you darknight, I'm one step closer, but the code you gave me changes the text in the textbox to the title of the tab, what I need to do is put custom text in. Also, how do you get the textbox to refresh (it will show the first clicked tab caption, but after that it doesn't work).

X_Darknight_X
Jan 19th, 2000, 10:29 AM
Sorry misread:

Select Case TabStrip1.TabIndex
Case = 0

Case = 1

Case = 2

End Select

Just put what you want to happen inbetween the cases.

Put

------------------
David Underwood
Cannabatech Corporation

ICQ - 14028049 (http://www.icq.com/14028049)
E-mail - darknight23@hotmail.com

QWERTY
Jan 19th, 2000, 10:33 AM
In case it didn't work:

Private Sub TabStrip1_Click(Index As Long)
Select Case Index
Case 0
'your code
Case 1
'your code ...
Case 2
'your code ...
End Select
End Sub


------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.

StudentProgrammer
Jan 19th, 2000, 10:37 AM
The problem is probably in what I'm doing, I've got a tabstrip and a textbox sitting on top of the tabstrip (is this wrong?). The code you posted (darknight) changes the text in the textbox to the wrong case (offset by one, but if I change the case #'s it doesn't work), but works only once, after that it stops working. Also, if I access the form again without stoping the program (go to another form, then back again) the tabstrip doesn't get reset. Any help would be greatly appreciated.

StudentProgrammer
Jan 19th, 2000, 10:42 AM
qwerty, when I put the "Index As Long" in the click event, it gives me the error message, "Event procedure declaration does not match description of event having the same name." I'm overlooking something simple aren't I? (it's pretty late where I live)

X_Darknight_X
Jan 19th, 2000, 10:48 AM
You have 3 tabs on there right?

------------------
David Underwood
Cannabatech Corporation

ICQ - 14028049 (http://www.icq.com/14028049)
E-mail - darknight23@hotmail.com

StudentProgrammer
Jan 19th, 2000, 10:50 AM
Yep,... also, off the top of your head, is there a way, when using multiple forms, "reload" a form or get VB to run through the formload code again? Thanks for all the time you're spending here.

X_Darknight_X
Jan 19th, 2000, 10:57 AM
Find and use SSTab Strip, it's a whole lot easier to use.

You have to unload the form first...
Unload Form1
Call Form1_Load
------------------
David Underwood
Cannabatech Corporation

ICQ - 14028049 (http://www.icq.com/14028049)
E-mail - darknight23@hotmail.com




[This message has been edited by X_Darknight_X (edited 01-19-2000).]

StudentProgrammer
Jan 19th, 2000, 11:01 AM
SSTabstrip is different then the ordinary Tabstrip right? That could be a problem because for some reason I don't get all the buttons on the toolbar (i.e. a lot of the more advanced buttons, SSTabstrip included, if it's a diff. button then tabstrip vanilla).

Sorry, kinda being a pain in the butt.

StudentProgrammer
Jan 19th, 2000, 11:12 AM
Thanks darknight, I got the form load thing to work, the last part of my program is the tabs, once I get them to work, I'll be finished... If it's any consolation all of you who helped are getting mentioned in my program, especially you darknight.

Thanks again.

StudentProgrammer
Jan 19th, 2000, 11:31 AM
I just went through the code line by line checking the value of the tabindext and no matter what tab I click on, the index is ALWAYS 0, how do I get it to change when I click on other tabs? If someone can tell me how to do this it would be GREATLY appreciated (I'll also be able to go to sleep :) ). Thanks for reading and a bigger thanks if you reply.