Results 1 to 8 of 8

Thread: Can one Class know the object of another Class?

Threaded View

  1. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Can one Class know the object of another Class?

    Yes....
    If TypeOf Oran Is Orange Then ' oran is an orange class

    Additionally. You can use TypeName(object) to check its name as a string.

    Edited: And if you really want to prevent any potential of error
    Code:
      
       If Not Oran Is Nothing ' will error if Oran not set to new Orange
          If TypeOf Oran Is Orange Then ' retun true?
       End If
    FYI: If Oran hasn't been set to New Orange, then TypeName(Oran)="Nothing" & (Oran Is Nothing)=True
    Last edited by LaVolpe; Mar 7th, 2008 at 04:29 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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