Is it possilble to get prwevious form control in the present form
Hi all i would like to have some code like this. I have entered a value in the text box, and hit ok then i am showing a new form. In this form can i get that textbox value to be used on hitting a control some thing like button or other control.
VivekhPosted Jul 9, 2010, 7:08 AM
Abhimanyu K VatsaPosted Jul 9, 2010, 7:02 AM
it is very simple
As you can refer
formname.controlname
VivekhPosted Jul 9, 2010, 4:40 AM
Root
|-> Child
|->a.txt
|->Child1
|-> a1.txt
If i select a child node i will load the corresponding panel and will have a text file
Now if i select a text file i will display a data grid with that data available in text file...
Now if i click on a cell i would like to display the same in the usrcontrol form but as i am loading it i can not access that so any idea to implement this
Rasmus StriibPosted Jul 2, 2010, 2:22 PM
public int PrevFormValue
{
get { return lblPrevValue.Text; }
set { lblPrevValue.Text = value; }
}
Marimuthu ArigovindasamyPosted Jun 28, 2010, 1:39 AM
public int PrevFormValue
{
get;
set;
}
and assign the 1st form text value into 2nd form label value
private void Form4_Load(object sender, EventArgs e)
{
lblPrevValue.Text = PrevFormValue;
}
when u call the 2nd form from 1st form, u have to call like this.
Form4 frm4 = new Form4();
frm4.PrevFormValue = this.txtNextForm.Text;
frm4.Show();