C # windows form, how to hide the panel and display after clicking the button?


I have a panel that contains a lot of textboxes and labels. I want to hide it before i enter password, after button click, that panel need to be shown. So when I try to run the program, it has null reference exception. I'm new at windows form coding.

public form1() {



Make sure you call this line after the InitializeComponent() method call in the constructor :-)


public Form1()

    // Your code here