05-19-2006 01:38 AM
I am trying to pass visa namespace between forms and I am really stuck!
I cannot figure out why I can see the mainform property from the other form.
Can someone give me a shove in the right direction, Please?
Here is some psuedo code:namespace instcontrol
class mainform
Public ReadOnly Property OpenedSession() As NationalInstruments.VisaNS.MessageBasedSession
Get
Return mbSession
End Get
End Property
Private Sub btnOpenSession()
...
mbSession = CType(ResourceManager.GetLocalManager().Open(txtSelectedResource.Text), MessageBasedSession)
...
End Sub
Private Sub btnOtherForm()
Dim Other as OtherForm = New OtherForm
OtherForm.ShowDialog
EndSub
End Class
Class OtherForm
Private Sub OtherForm_Load()
If Not (InstrumentControl.MainForm.OpenedSession Is Nothing) Then
PopulateSessionTreeView()
Else
Me.Close()
End If
End Sub
End Class
End Property
05-22-2006 02:08 PM
This is a duplicate discussion forum post. See the following thread.
http://forums.ni.com/ni/board/message?board.id=140&message.id=17397&jump=true
Regards,