are you calling the Activated event because there is code in that event that
you want to execute? or do you want to 'Activate' the form?
If you are calling the Activated event because you want to execute the code
in that event sub routine, I would recommend moving the code from the
activated event and place it in your own routine ... myActivated or
something ... call your myActivated routine from the form's activated event
and any other place in your code that requires your myActivated
functionality. I would avoid triggering events to simply run
functionality...isolate the functionality in a seperate routine ... and call
this routine from all the events.
If you are calling this method to activate the form ... does setting focus
to the form trigger the event? If your form already has focus, and you need
to 'reproduce' the activated functionality, refer to above suggestion,
isolate the activated functionality in your own routine and make calls to
this routine from the activated event and any other place you need it.
I find 'triggering' system events lead to performance hits ... Also, I would
be careful coding you activated event ... you or the user could end up in an
endless loop.
Yes, I wanted to call code within the Activate event. However, as you
indicated, this did lead to problems so I did as you suggested i.e. wrote a
myActivated routine. This now works fine.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.