Results 1 to 4 of 4

Thread: if objreference = nothing then.../ERROR?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    if objreference = nothing then.../ERROR?

    If Toolbar1.ImageList = Nothing Then \ERROR invalid use of object
    Set Toolbar1.ImageList = ImageList1
    End If

    plz help

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: if objreference = nothing then.../ERROR?

    VB Code:
    1. If Toolbar1.ImageList[B] Is [/B]Nothing Then
    2.     Set Toolbar1.ImageList = ImageList1
    3. End If

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: if objreference = nothing then.../ERROR?

    Use Is Nothing

    VB Code:
    1. If (Toolbar1.ImageList Is Nothing) Then

    Edit: D'oh beaten by Pradeep again

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    Re: if objreference = nothing then.../ERROR?

    thx, do apologize for my very newbie question...but I think I will have some..

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