Q

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 first 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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close