Results 1 to 6 of 6

Thread: 'if' question{resolved}

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    england
    Posts
    161

    'if' question{resolved}

    I want my code so that if no tabstrip is selected the caption of the form is blank, or just 'StarSurfer v1.1 'or whatever. The code i have so far is:

    VB Code:
    1. Me.Caption = WebBrowser1(TabStrip1.SelectedItem.Tag).LocationName & "  StarSurfer v1.1"
    2.         End If

    this doesnt work if no tab is selected, i get an error.

    I've tried this code:

    VB Code:
    1. If TabStrip1.SelectedItem = Nothing Then
    2.         Me.Caption = "Starsurfer v1.1"
    3.         Else
    4.         Me.Caption = WebBrowser1(TabStrip1.SelectedItem.Tag).LocationName & "  StarSurfer v1.1"
    5.         End If

    but i get the error "invalid use of object"

    anyone know what i should do??
    Last edited by shaunyboy; Dec 1st, 2003 at 01:43 PM.

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