Solved Unkown Cls/Collection Holding An Event

Hey guys don't spend anymore time on this; you've already been too generous. I'm playing around more, getting a better understanding & probably come up with something not puristly correct, but may work. I'll update the thread on how I get on.

Things are finally starting to get a bit better after nearly 2 weeks of studying it full time.
I've been trying to run before I can walk. I'm playing around, using a cls for the MenuBar... storing more properties in the right-click event into a collection & I think I might be able to refer to these later. Getting the value back from there/ passing through other classes...
I'm understanding basic classes a bit better now. It hasn't been an ideal first class experience as I've been overwhelmed by doing a CmdBar for the first time, with Advanced Decoupling on my first class. I've been running before I can walk. Thanks for all your patience & input.

Maybe he sees something I do not or is just a nicer person.

I wanted to be encouraging & grateful but I must admit I removed it prior to your post. Not to be ungrateful @BlueSpruce :ROFLMAO: but I'd have to agree with @MajP here :ROFLMAO:.
 
Hey guys don't spend anymore time on this; you've already been too generous. I'm playing around more, getting a better understanding & probably come up with something not puristly correct, but may work.
I do not think Mark and I were necessarily focused on solving your specific problem, but more on demonstrating coding concepts and techniques that you and others can use anywhere.
Mark identifies some general design concepts that you should strive for
With this approach, the functionality you call at handleRightClickOnBillAndPageF() is encapsulated within the class. This promotes tidy code, because it reduces the pollution of your global namespace with a proliferation of standard module based Public Sub HandleRightClickOnBillAndPageF-like methods.

For even more flexibility, create a cTextBoxRightClickHandler class, and pass in a cBillAndPageFStrategy class ( which exposes an Execute() method ). This way you can decouple generic right-click textbox handling from what actually happens when the right click occurs, which is provided by the Strategy class at runtime
I may have approached this differently, but still trying to incorporate these concepts of encapsulation, clean and efficient code, flexibility, and decoupling / loosely coupled design.
 
Idemonstrating coding concepts and techniques that you and others can use anywhere.
This is more valuable than anything. Understanding best practices & the reasons behind them.
Mark identifies some general design concepts that you should strive for
Yes I'm most grateful. You've been a massive help yourself also. I received several solutions to my problem here but more importantly you've both helped me to grasp the concept of OOP, which I simply couldn't have done on my own. Achieved on inadequate info to boot.
Thanks again.
 

Users who are viewing this thread

Back
Top Bottom