Hi to all
I'm developing an application using C#.net .My problem is
I have two forms Form1 and Form2... I have a combo box in Form1 with values Admin , student and others....Form1 is used as login form . If login by student i want to hide certain buttons and labels form him ... If it is a admin i want to display all the components.......

I used this codes....

in Form1.....

public void button1_Click(object sender, EventArgs e)
{
    Form2 f=new Form2(usercomboBox1.Text);
    f.ShowDialog();
}

in Form2....

public void Form2_Load(object sender, EventArgs e)
  {     
          if(usercomboBox1  == "Student")
            {
                usrperButton.Visible = false;
            }

   }

it is showing a error

usercomboBox1 does not exist in Form2


I have tried different methods i could not do it ....... if u people any method or any other idea to accomplish this task i'll be glad....


Thanks in advance....

thanks for your help i found the answers myself...........

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.