Option Explicit On
Option Strict On
Module Mod_Test
Sub test()
formTest.TextBox1.Text = "hello"
End Sub
End Module
I created a Windows Form application and Class Library application with one UserForm and One module.
The UserForm name is formTest it contains one textbox.
The Useform is a PUBLIC class in both applications.
I can use ( formTest.TextBox1.Text = "hello" ) in the Windows Form Application but not in the Class Library Application.
Why the difference ???Code: [Select]
Option Explicit On
Option Strict On
Module Mod_Test
Sub test()
formTest.TextBox1.Text = "hello"
End Sub
End Module
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.
My.Forms object is available in a Windows Forms application but not available in a console application