You don't show the code in the Winforms Application, only the code from the classlibarary project.

Could it be that the code in the winforms application is in the formTest class?

If so, then the reason it works is because it is a member of the formTest class, and has access to non-public members of that class. The TextBox1 member variable in your form is most-likely declared as Private, which means it is not visible to code outside of the formTest class.

« Last Edit: August 10, 2012, 09:23:50 pm by TT »

Logged

fxcastil

You don't show the code in the Winforms Application, only the code from the classlibarary project.Could it be that the code in the winforms application is in the formTest class?If so, then the reason it works is because it is a member of the formTest class, and has access to non-public members of that class. The TextBox1 member variable in your form is most-likely declared as Private, which means it is not visible to code outside of the formTest class.

I have created a seperate module, in both applications. Both applications have the same modue (Mod_Test) in which the code resides.The userforms are the same in both applications, the userform is a public class. I have double checked the userform of both application to ensure they are identical. I can't access the properties (buttons and other controls ) of a public class userform in the seperate module of the Class Library Application.

when you use the same name as the form it is a shortcut to My.Forms.FormName and if you change the class library to a window form app them it will add it to settings file but it is not global but a shortcut to a shared method that makes look like one

fxcastil

Keith and Jeff thanks for your input. Keith I understand you example and it was very concise.

But again why the difference the two types of application (attached) ?

Where is the textbox property of the userform defined/exposed as a public property in the WindowsFormApplication?

I found this example about userforms in VB.net and VB.It talks about userforms in Vb.net not having a global scopeBut again (being redundant) the WindowsFormApplication.NET does have global scope of Userforms, but the ClassLibraryApplication.Net does not have global scope of Userforms.