Results 1 to 14 of 14

Thread: Tabstrips

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    use the click event

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

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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?

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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).

  5. #5
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    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
    E-mail - [email protected]




  6. #6
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    In case it didn't work:
    Code:
    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.


  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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)

  9. #9
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    You have 3 tabs on there right?

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

    ICQ - 14028049
    E-mail - [email protected]




  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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.

  11. #11
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    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
    E-mail - [email protected]





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

  12. #12

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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.

  13. #13

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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.

  14. #14

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    13

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width