
Passing parameters to a form load procedure
Quote:
>> I was wondering how you can pass parameters to a form's load sub
procedure
>> ie. form_load(byval some parameter)
>> I can not seem to get this to work
>> It is either i) not allowed
>> ii) I am not calling it right
>> iii) ???
>It doesn't work..., basically it is not allowed...
>Something microsoft should think of for v.4.0...
>> I know I can set a global var to the value but I do not want to do it
>> this way.
>This is the only method available at this time... I've tried setting a
>form's Tag with info, before it "show'd" itself, but that doesn't work
>fast enough.
Yeah. It is regrettable that MS didn't think this one through very well.
However, I don't think using a global variable is particularly loathsome.
It will only be needed for a brief period of time and can be reused
amongst multiple forms since form loading will generally be an atomic
process.
Setting a form's tag property does indeed appear to be somewhat flaky. It
worked for me until I put a CSFORM.VBX control on my form; this
subclasses the form's window procedure to provide scrolling form
capabilities. At that point, my code broke, because setting the tag
property caused the VBM_SETPROP message to get to the form AFTER the form
was loaded due to the subclassing.
Of course, some really cunning person out there may have a better
solution.