tvanstiphout
Well-known member
- Local time
- Today, 09:08
- Joined
- Jan 22, 2016
- Messages
- 741
@eric: in your Frameworks article you write: "A form wrapper created in Form_Open() cannot sink that event because it already will have occurred. The form wrapper’s Class_Initialize() can be a viable proxy, however."
True, and yours is a fine implementation (although you're not showing it in Class_Initialize code). I do it a bit differently:
Similar to your BoundFrm property I have an Init method, taking a form reference as an argument. It sets the event handlers, and at the bottom:
'Fake the OnOpen call which has already happened.
Dim intDummy As Integer
mfrmThis_Open intDummy
I find this elegant because it follows the same pattern as other events.
As we have discussed privately, New-ing the object and calling its Init method can both be done in what's often called a Factory method. Not shown in this post.
True, and yours is a fine implementation (although you're not showing it in Class_Initialize code). I do it a bit differently:
Similar to your BoundFrm property I have an Init method, taking a form reference as an argument. It sets the event handlers, and at the bottom:
'Fake the OnOpen call which has already happened.
Dim intDummy As Integer
mfrmThis_Open intDummy
I find this elegant because it follows the same pattern as other events.
As we have discussed privately, New-ing the object and calling its Init method can both be done in what's often called a Factory method. Not shown in this post.