|
-
Apr 21st, 2004, 09:29 PM
#1
Thread Starter
Frenzied Member
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.
-
Apr 21st, 2004, 09:38 PM
#2
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|