Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I pass property to another form.

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

 

0 Kudos
Message 1 of 2
(6,251 Views)

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,

Missy S.
Project Engineer
RoviSys
0 Kudos
Message 2 of 2
(6,235 Views)