Results 1 to 2 of 2

Thread: Referencing An Object On Another Form [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,374

    Referencing An Object On Another Form [RESOLVED]

    I want to reference a control on a another form.

    In VB6, you could do this with "Form1.Control1" but the objects belonging to Form1 don't appear in .NET.

    I have tried changing the .NET generated declaration of the control from "Friend" to "Public" but that didn't work either.
    Last edited by robertx; Apr 21st, 2004 at 09:38 PM.

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,374
    I resolved this by declaring the first form as Public and giving the instance of the form a different name to the form's class:

    Public frmMain As New Form1

    I am then able to reference the form's objects from any other form with "frmMain."

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