Results 1 to 3 of 3

Thread: strange global problem

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    46

    strange global problem

    hello all,

    i have a class in my project, and i am declaring a number of things from it using PUBLIC

    however, non of these things seem to work outside of the class. I have changed the name of the class if that makes a difference. But whenever i use something declared from the class it says that it has not be declared yet, thus the evil blue line.

    any suggestions? i have gone through some of my older projects and have written the exact same things, but still, nothing.

    thanks

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: strange global problem

    vb Code:
    1. Public Class Form1
    2.     Inherits System.Windows.Forms.Form
    3.  
    4.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    5.         Dim t As New Test
    6.         t.DoSomething()
    7.     End Sub
    8. End Class
    9.  
    10. Public Class Test
    11.     Public Sub DoSomething()
    12.         'Code here
    13.     End Sub
    14. End Class
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: strange global problem

    If you want to use class members without having to declare a class object you can declare them as "Shared"
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

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