Minimize a SharePoint web part programmatically

We have lot of times minimized a web part on a SharePoint page. That day there was a requirement to minimize the web part programmatically. It’s simple, see it how

this.ChromeState = PartChromeState.Minimized;

ChromeState options are Minimized or Normal, with Normal being the default. Normal will display your Web Part on the site in its entirety, whereas Minimized will display only the Web Part’s title bar