So here is my code: https://ptero.co/hasunotuwi.cs
I'm making a license system, I want to hide the MetroForm after the key is invalid or if the key isn't found in the database. It's a school project, so don't worry about the DB credentials being in plain-text. After I run the code It should display a MessageBox saying "Your activation is not valid." and hide the MetroForm. Instead it displays the MessageBox and the MetroForm shows up like nothing happened.
The problem was fixed. The thing is that Load event is executed before the form shows, so there is nothing to hide. Instead I created a bool named isHidden and assigned false to it. Next, I assigned true whenever I needed the form to hide and last I created a void for the Shown event and it looked like this: