Results 1 to 11 of 11

Thread: Click a Tabstrip

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Hello!
    I use a tabstrip to let the user switch between different textfiles, but I also use a command to let them do it without click the tabstrip.
    Is there a way to make the tabstrip change, without to click it?
    I can call the function Tab_Click(), but it doesn't take any arguments. And Tab.SelectedItem.Index is Read-Only property.

    Any help appreciated!
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    use the SStab control instead because it's much better.

    then you can change tabs by

    SSTab1.Tab = 2'or whatever


    you can then do a select in SSTab1_Click

    Private Sub SSTab1_Click(PreviousTab As Integer)
    MsgBox SSTab1.Tab
    End Sub
    Mark
    -------------------

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Exactly how do you mean?
    Could you post the code for making it select another tab (without clicking the tab)?
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  4. #4
    Addicted Member
    Join Date
    Mar 2000
    Posts
    168
    What mark means is that you can set the tab of the tabstrip through code instead of clicking. The code used to do that is sstab1.tab = X, but you need to decide HOW you want it to change, whether by commands buttons (which doesn't make sense since you want an alternative way to clicking the tab) or by a keystroke. In the case if the keystroke, you would need to trap the keydown or keyup event of the form (set keypreview to true on the form). If you need an example of how this is done, let me know.

    Thai

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    What I really want to is when yhe user opens a new (text)file i want it to be the active text, and then I want the tabstrip to change to show this.
    But I'd very much appreciate an example, my brain seems a little bit slow for the moment.
    I was editing video for a biology project until two this morning, and then I failed completely on e test in German.
    Sigh...
    So please, post an example.

    Thanks a lot,
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Well, I tested with a SSTab, but it seems as if it can't contain less tabs then three.
    Is there a way round this? I want to be able to start on one and let the user add och remove tabs on at the time.
    It seems very unnecessary to have a lower limit for the number of tabs, or is there a reason for it?

    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  7. #7
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    You can have just one tab on an SSTab!


    right-click on the control
    click properties
    and set Tab Count to 1


    Mark
    -------------------

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Well, I tried but it says it's "Invalid Property Value"
    That happens when I try to set the number of tabs to a number below three, eiter at designtime or ruintime.
    Is this a bug in VB?
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Just posting to get it back on top again.
    Please, I really need some help here.
    Pentax

  10. #10
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658

    Thumbs up Give this a whirl

    Code:
    TabStrip1.Tabs(iIndex).Selected = True
    Where iIndex is the index of tab that you want to show. Simple really.
    Iain, thats with an i by the way!

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Well, yes, that's easy but it's not really my problem.
    I can't get the number of tabs to be less then three. Every time I try to set the number to one or two, at designtime or runtim, it says invalid value property.

    What have I done wrong?
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

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