I have a combobox1 on form1, but i wanna access it on form2 (able to full edit) is it possible by turning it public and using

form1.comboBox1_ChangedItem(blablabla)
{
// stuff
 }

?

Edit: there was a answer here, i was trying to implement it but it got deleted.. what happened?

有帮助吗?

解决方案

Making a combobox public does violates the rules of object-oriented. Better way is use a property to do this.

 Public ComboBox1
 {
      get { return this.comboBox1;  }
      set { comboBox1 = value; }
 }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top