cmdX.Click() dodefault() thisform.DeleteClient() return oSomethingElse.SomeOtherMethod() ... thisform.DeleteClient() ... returnIf the codeblock is short and not needed to be called from elsewhere I'm likely to just stuff it into the cmd.Click() instead of going through all of the effort to create a method. If I find later on that the codeblock needs to be reused I instantly promote it to a method of the common container.
this.parent.DoMyThingForMe() where the cmg just has a uniqely named method for each button like DeleteClient(), AddClient(), etc. I think this makes you code much more readable, you can see at a glance from the cmd.Click() what's going to happen you don't have to go off to the cmg.Click() to find that information.
Another big downside to your CASE statement comes if you move a button. Then you have your buttons out of sequence or you have to move your CASEs around.
>Ok, here’s what I’m trying to do. The CLICK event in the cmg has a case statement:
>
>DO CASE
>CASE THIS.VALUE = 1
> * Do thing 1
>CASE THIS.VALUE = 2
> * Do thing 2
>CASE THIS.VALUE = 3
> * Do thing 3
>CASE THIS.VALUE = 4
> * Do thing 4
>ENDCASE
>
>There are other situations in which I want the code associated with the case to execute. These are associated with another form in the form set. I don’t want the second form to be concerned with what happens when the button is clicked, I just want the action to occur.
>
>There are dozens of ways to do this, but I’m interested in finding the most elegant or best in terms of the object model. Being the neophyte that I am, this has become an exercise in understanding the basics. I really appreciate your help!