public Settings(Controller contobj1, MainPage pointer, int priv) { InitializeComponent(); contobj = contobj1; //taking the previous's form controller p = pointer; //taking an object from the previous form privi = priv; if (privi != 1) { User.Enabled = false; UP.Enabled = false; UCP.Enabled = false; UT.Enabled = false; button1.Enabled = false; UUT.Enabled = false; } string[] PrivNames = new string[3] { "Admin", "Accountant", "Cash Collecter" }; //filling the commbobox string[] PrivNames1 = new string[3] { "Admin", "Accountant", "Cash Collecter" }; //filling the commbobox UT.DataSource = PrivNames; //filling the commbobox UUT.DataSource = PrivNames1; //filling the commbobox UT.Refresh(); //refreshinng the combobox UUT.Refresh(); //refreshinng the combobox }