Every programmer knows these situations: you are in the middle of programming something when you realize you need to do a thing you never did before. Instead of opening library/programming language/toolkit documentation, you just fire up google, type in a few keywords and import the first snipped that google finds straight into your source code.
I’ve hit these situations many times. The problem is that usually these snippets are just plainly wrong. Often, you end up importing source code from a 12-year old blogger with 3 months of experience in programming. Not really what you want to do in production code.
The first one didn’t really do what I needed. And when I saw the ugly P/invokes in the second one, I decided to do it myself.
The solution was dead simple: set
Maximized. That’s it. A fullscreen form without P/invokes or other voodoo, that will even work with Mono.
So, be careful with random web code snippets and always read comments for the article where those snippets appear. They are usually pretty good at telling you if this is a bad solution and pointing you in the right direction.