/
Support Statement: Migrate Form_Load as event handler
Support Statement: Migrate Form_Load as event handler
At present, the default translation of Form_Load is as a method that is invoked from the form constructor. You may want to migrate it to an event handler instead. The following RefactorLibrary for the VB7Lang meta-language definition will help you do that:
mig.VB7Lang.xml --------------- <MetaLanguage> <!-- Description: apply metalang overrides --> <Refactor id="Basic" > <Replace id="Patterns"> <pattern id="FOR"> <subcode id="Load"> <!-- hook Form_Load to Load Event rather than deleting it --> <!-- see also postedit to remove calls to Form_Load in ctor --> <all role="event" narg="0" code="Load" /> </subcode> </pattern> </Replace> </Refactor> </MetaLanguage> Upgrade.Rules.xml ------------------ <Author Condition="%SrcName%=~'...'"> <Fix host="%SrcName%" name="PostEdit"> <Replace status="active" name="Remove Form_Load from Form ctor to alter load sequence; hooking to Load event instead"> <OldBlock><![CDATA[ Form_Load(null, null); ]]></OldBlock> </Replace> </Fix> </Author>
, multiple selections available,
Related content
Custom VB6 Language Replacement
Custom VB6 Language Replacement
More like this
Support Statement: Override a routine in authortext.gmsl
Support Statement: Override a routine in authortext.gmsl
More like this
Custom COM Replacement
Custom COM Replacement
More like this
Translation Myth Busters
Translation Myth Busters
More like this
Samples
Samples
More like this
gmplMigrateStatement
gmplMigrateStatement
More like this