Hi.
I'm hoping someone can shed some light on this bizarre problem that I have come accross. I have spent all evening trying to fix it with no luck!
I have a frameless Windows.Forms form with a transparent background displaying a .png image with rounded corners. The form holds a WebBrowser instance and can be open or closed. When closed, a thin bar .png is used for the background. So far, so good.
Here's the problem:
When the form is first launched, it is in it's closed state:
this.ClientSize = new System.Drawing.Size(371, 29);
this.MaximumSize = this.Size = new System.Drawing.Size(371, 29);
However, despite these lines of code, the form always starts with a minimum height of about 35 - 40 px, which shows the top 10px or so of the WebBrowser (white rectangle in picture). Adjusting the values in the lines of code above below this level make NO difference whatsoever, but making them 40px or more DOES make the form size change.
Now here's the really strange bit:
When I click the open button to show the WebBrowser and then click it again to close it to the 29px height control bar, it DOES go to 29px. (see picture below)
I have tried calling the button's Click method programmatically in the constructor and that doesn't work either. I've tried everything that I can think of, so I'm really hoping someone can help me out here.