Just ran into an issue with VB.net after years in VB6. I'm attempting to pass a form to a public sub without success.
This worked in vb6
vb Code:
Public Sub MySub(frm As Form) MsgBox (Val(frm.Text1.Text) + Val(frm.Text2.Text)) End Function
But when I attempt to do the same in .net i get an error with the below saying Text1 and Text2 are not members of System.Windows.Forms.Form.
vb Code:
Public Sub MySub(ByRef frm As System.Windows.Forms.Form) MessageBox.Show(Val(frm.Text1.Text) + Val(frm.Text2.Text)) End Sub
Any idea's?




Reply With Quote