Results 1 to 5 of 5

Thread: declaring an OpenFileDialog object in a class for global use *RESOLVED*

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    declaring an OpenFileDialog object in a class for global use *RESOLVED*

    I am trying to declare an instance of the OpenFileDialog object in a class, which is in a class library with the line
    VB Code:
    1. Public o As New OpenFileDialog
    This line works fine in the form.vb file but then in the class.vb file the OpenFileDialog is underlined with a blue wiggle.

    How do you declare an OpenFileDialog object in a class for global use?
    Last edited by davidrobin; Jul 29th, 2004 at 10:17 AM.


    Things I do when I am bored: DotNetable

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    Found the problem.
    I hadn't added a reference to the system.windows.forms.dll.

    Now it works.


    Things I do when I am bored: DotNetable

  3. #3
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Re: declaring an OpenFileDialog object in a class for global use *RESOLVED*

    Originally posted by davidrobin
    I am trying to declare an instance of the OpenFileDialog object in a class, which is in a class library with the line
    VB Code:
    1. Public o As New OpenFileDialog
    This line works fine in the form.vb file but then in the class.vb file the OpenFileDialog is underlined with a blue wiggle.

    How do you declare an OpenFileDialog object in a class for global use?
    how did you realise this? you mentioned a blue wiggle, that means there's an error in the code.

    I always have the Task List visible so that I can see what the errors are, and what I have to do.

    View > Other Windows > Task List (Ctrl+Alt+K)

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    I think the blue wiggle was indicating an undeclared custom something.

    The class didn't know what OpenFileDialog was.


    Things I do when I am bored: DotNetable

  5. #5
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    yeah, just giving a tip for that task list. i really like it myself, and i don't think its even default to appear when you first install vb.net

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