Assign a Window Property

Hey guys,

So I have this code:

Dim thisSession as Session = "somesessionobject"     // an existing Exercise Session Object

Dim w as New wndSessions      // wndSessions is an Implicit Instance window
w.LO_Session = thisSession      // LO_Session is a local (Session Obj) property on w

My problem seems to be that I can’t assign ‘thisSession’ to the window after it has been instantiated?
LO_Session is Nil after the Open?

If I have to do the assignment after the window is created, i.e., in the Open event then I’m going to need a GLOBAL to hold the Session Object. Not Ideal.

Am I missing something here?

Thanks in Advance.

Dim w as New wndSessions

The Open event fires before this line ends, so LO_Session is not set until after the Open event. You can create a constructor that accepts a wndSessions object and assigns it to LO_Session before calling Super.Constructor (which in turn calls the Open event).

Many Thanks Tim. :wink: