Many of you might already know this, but I just caught on to it this weekend. I have not been about to find a way to hide the entire container programmatically when a business case asks for it. However, the way I found to do it was built in to the DotNetNuke® framework.
I do not remember it being there before, so I can only hope I was not blind before and it is new. :)
Anyhow, the coveted line of code to programatically hide the container, and in turn the entire module is this:
Me.ContainerControl.Visible = False
I have successfully tested and used this line of code in DNN v4.09.00 module development. I have only tested using it in the Page_Load event so far.