Skip to main content

Posts

Showing posts from July, 2008

Accessing a windows form controls from another class

Answer is in this page: http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=34453 In case its not accessible If we have two classes like these testclass.cs: using System; using System.Collections.Generic; using System.Text; namespace clTestProg { public class testClass { public void InitControls(System.Windows.Forms.GroupBox gbx) { System.Windows.Forms.Button buttonODelete = new System.Windows.Forms.Button(); System.Windows.Forms.Button buttonOUpdate = new System.Windows.Forms.Button(); System.Windows.Forms.Button buttonOAdd = new System.Windows.Forms.Button(); // // buttonODelete // buttonODelete.Location = new System.Drawing.Point(251, 324); buttonODelete.Name = "buttonODelete"; buttonODelete.Size = new System.Drawing.Size(75, 23); buttonODelete.TabIndex = 0; buttonODelete.Text = "&Delete";