Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15214

Subclass ALL forms in an application

$
0
0
Hello, I am trying to intercept the CREATE and DESTROY messages for every form that opens and closes in my project. Once intercepted, I would implement some logic.

I figured subclassing would be a good way to do it, but it looks like I need to modify every single form for it to be subclasses. I am trying to avoid modifying every single form as there are too many of them.

I was able to successfully intercept these events by implementing hooks, but based on what I have read so far, hooks is not an ideal solution.

Is there way to achieve this? I am trying to come up with central code that runs when the application starts (first form loads) and CREATE/DESTROY events for all subsequent forms within the application are intercepted by a central handler. So if I were to create an instance of a form and show it when the user clicks a button, the centra handler should be able to intercept its CREATE event.

Viewing all articles
Browse latest Browse all 15214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>