Problem solve Get help with specific problems with your technologies, process and projects.

How do you reference a form control from a module?

How do you reference a form control from a module? This is something that should be easy to do but it's nowhere in the documentation. This is what I've tried so far:

Dim objfrmMain as form
objfrmMain = New frmMain
objfrmMain.control ?????????
Since form controls are declared with Friend scope in VB.NET, you are probably running into the issue that those controls can only be accessed from code inside the same assembly. The documentation is quite clear about the Friend levels of recognition.

This was last published in May 2003

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.