C#.net programs are completely build upon class hierarchy, unlike VB.Net it is a full fledged OOP language.
The first problem newbie faced in C#.Net while migrating from VB.Net was the global accessing of controls in other classes. In C# every Windows Form is a partial class derived from Form. This problem can be solved by creating properties with Get and Set method.
public partial class Product_Registration : Form
public string _txtPcode
txt_Pcode.Text = value;
Once you are created the object you can Set or Get values from the control as follows.
Declare the form Object in general section of a Form class,where you would like to access the controls.
public Product_Registration frm_PR = new Product_Registration(); frm_PR._txtPcode=”S706″;
will set the Text Box with “S706” string using the Set method You can also get the string from control using the Get as,
Messagebox.show(this._txtPcode) — from the Form itself
<<<That is all I have today…. please leave comments on Disqus>>>