For starters, winforms will complain that you cannot set the background of the form to transparent. After a little digging, I found on a stack over flow post that you can set the background to an obscure colour like limegreen. Lo and behold, we have a properly transparent form. I was using this for a quick and dirty way to select an area to screen capture. However there is one issue. The transparent form results in the click events going through to what ever is underneath it. As illustrated in the screen shot above, you can select text directly underneath it. This is pretty cool, especially if TopMost is set to true. However...the grip resize was also not being triggered. In other words, I cannot resize the new form. If the grip was on top of the parent form, then the resize event would work. I tried a few approaches, such as intercepting the hittest, a few interops. But in the end the solution was quite simple.If you set the background colour to AliceBlue...
Comments
Post a Comment