Message 1 of 3
Access Form1.vb from Class.vb
Not applicable
03-02-2009
09:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a class file and a Form1.vb file in my project.
I need to read the values of Form1.vb (example: value of textbox1.text in Form1.vb) from my class.
Somehow I am getting nothing returned when I try to acces the values on the form.
I guess it's because I am having the following statement in my class:
_
Public Sub NewCmd1()
Dim myForm As New Form1
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(myForm)
End Sub
_
Public Sub MessageboxTest()
Messagebox.show(myForm.Textbox1.text)
Messagebox.show(myForm.Combobox.text)
End Sub
If I call MessageboxTest(), the values are nothing.
If I don't declare "Dim myForm As New Form1" I cannot get the form to display, but if I do this, I cannot get
the value of any of the comboboxes or textboxes. Can anybody help ?
I need to read the values of Form1.vb (example: value of textbox1.text in Form1.vb) from my class.
Somehow I am getting nothing returned when I try to acces the values on the form.
I guess it's because I am having the following statement in my class:
Public Sub NewCmd1()
Dim myForm As New Form1
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(myForm)
End Sub
Public Sub MessageboxTest()
Messagebox.show(myForm.Textbox1.text)
Messagebox.show(myForm.Combobox.text)
End Sub
If I call MessageboxTest(), the values are nothing.
If I don't declare "Dim myForm As New Form1" I cannot get the form to display, but if I do this, I cannot get
the value of any of the comboboxes or textboxes. Can anybody help ?