Reputation: 1899
I had windows form I did my code to display panel where condition but this error apeared (object refrencer.....) on panel1.Show();
public partial class Checker : Form
{
public Checker()
{
RegistryKey adobe = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe");
if (adobe == null)
{
panel1.Show();
}
}
private void OK_Click(object sender, EventArgs e)
{
}
}
Upvotes: 0
Views: 305
Reputation: 3299
Seems like you don't have an instance of your panel1. Where is it declared? Is it a panel on a form somewhere? If so, where is your form declared?
If the code above is your form, you might want to call
InitializeComponent();
before you continue your constructor.
Upvotes: 3