how to call a panel or groupbox of one form from another from in c# window form application
hii friends i have created a filter for filtering the data in roup box in one form n i want to call this group box every where in my application how to do this
VulpesPosted Jul 26, 2012, 6:55 AM
Secondly, you'll need a reference to the Form which contains the GroupBox. Suppose the class name of that form is Form1. Then you can get a reference to the form (and hence the GroupBox) from anywhere else in the application as follows:
Form1 f1 = (Form1)System.Windows.Forms.Application.OpenForms["Form1"];
GroupBox gb = f1.groupBox1; // or whatever you've called it
Finally, you can access individual controls in the GroupBox in the following fashion:
TextBox tb = (TextBox)gb.Controls["textBox1"];