Assign a Window Property

  1. 5 weeks ago

    Ken B

    Sep 17 Brisbane, Australia

    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.
    Ken.

    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).

  2. Tim H

    Sep 17 Pre-Release Testers Answer Portland, OR USA

    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).

  3. Ken B

    Sep 17 Brisbane, Australia

    Many Thanks Tim. ;-)

or Sign Up to reply!