I have a DropDownList control in a panel and this panel is in turn placed in a SplitContainer‘s panel1. I changed the modifiers property to ‘Public’ for the DropDownList but I can’t access this control from another class.
//created instance of the form
Payment pForm = new Payment();
I am able to access other controls which are placed outside of the split container as below.
string amount = pForm.tbAmount.Text;
But I can’t access the dropdownlist control.
A split container has 2 panels, and each panel has a collection of controls, so:
Obviously in order to be able to access
pForm.SplitContainer1from outside of thePaymentform class you will have to provide a public getter to it.And if you wanted to further constrain by the name of the dropdown (assuming you had multiple dropdowns in this panel):\