Click here to Skip to main content
15,897,334 members
Home / Discussions / C#
   

C#

 
QuestionRe: Play sound [modified] Pin
jojoba201130-Mar-10 21:10
jojoba201130-Mar-10 21:10 
AnswerRe: Play sound Pin
Kristian Sixhøj31-Mar-10 0:14
Kristian Sixhøj31-Mar-10 0:14 
QuestionXml Deserialization Pin
VCsamir30-Mar-10 19:43
VCsamir30-Mar-10 19:43 
AnswerRe: Xml Deserialization Pin
Arun Jacob30-Mar-10 20:09
Arun Jacob30-Mar-10 20:09 
GeneralRe: Xml Deserialization Pin
VCsamir30-Mar-10 21:37
VCsamir30-Mar-10 21:37 
AnswerRe: Xml Deserialization Pin
Mirko198030-Mar-10 21:43
Mirko198030-Mar-10 21:43 
GeneralRe: Xml Deserialization Pin
VCsamir4-Apr-10 20:21
VCsamir4-Apr-10 20:21 
QuestionPassing Value From One Form To Another! [modified] Pin
Sr...Frank30-Mar-10 18:22
Sr...Frank30-Mar-10 18:22 
Hi,
I am trying to pass value from one windows form to another in desktop application using C#.
I have created two text boxes on Form1 and a button, on button click I am creating Form2 and From2 contains one button, on this button click I have to pass value from Form2 to Form1 textboxes.

I have created Properties in Form1.

public string Emp
{
get
{
return strEmp;
}
set
{
strEmp = value;
}
}

public string EmpID
{
get
{
return strEmpID;
}
set
{
strEmpID = value;
}
}


And on Form1 button click:

private void button1_Click(object sender, EventArgs e)
{
Form2 fr = new Form2();

this.textBox1.Text = strEmp ;
this.textBox2.Text = strEmpID ;
fr.ShowDialog();
}


On Form2:

private void button1_Click(object sender, EventArgs e)
{
Form1 fr = new Form1();
fr. Emp = "Alex";
fr. EmpID = "1121";
this.Close();
}

This code is not working, Please let me know where I am wrong.

Thanks,
modified on Wednesday, March 31, 2010 12:54 AM

AnswerRe: Passing Value From One Form To Another! Pin
Anubhava Dimri30-Mar-10 18:27
Anubhava Dimri30-Mar-10 18:27 
AnswerRe: Passing Value From One Form To Another! Pin
Praveen Raghuvanshi30-Mar-10 18:45
professionalPraveen Raghuvanshi30-Mar-10 18:45 
GeneralRe: Passing Value From One Form To Another! Pin
Sr...Frank30-Mar-10 18:56
Sr...Frank30-Mar-10 18:56 
GeneralRe: Passing Value From One Form To Another! Pin
Praveen Raghuvanshi30-Mar-10 21:43
professionalPraveen Raghuvanshi30-Mar-10 21:43 
AnswerRe: Passing Value From One Form To Another! Pin
DaveyM6931-Mar-10 0:43
professionalDaveyM6931-Mar-10 0:43 
QuestionRepositioning the cursor Pin
skhan1730-Mar-10 12:49
skhan1730-Mar-10 12:49 
AnswerRe: Repositioning the cursor Pin
PIEBALDconsult30-Mar-10 12:56
mvePIEBALDconsult30-Mar-10 12:56 
AnswerRe: Repositioning the cursor Pin
skhan1730-Mar-10 13:11
skhan1730-Mar-10 13:11 
AnswerRe: Repositioning the cursor Pin
Paw Jershauge30-Mar-10 13:24
Paw Jershauge30-Mar-10 13:24 
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 13:36
skhan1730-Mar-10 13:36 
GeneralRe: Repositioning the cursor Pin
Paw Jershauge30-Mar-10 13:40
Paw Jershauge30-Mar-10 13:40 
GeneralRe: Repositioning the cursor Pin
Paw Jershauge30-Mar-10 13:53
Paw Jershauge30-Mar-10 13:53 
GeneralRe: Repositioning the cursor Pin
PIEBALDconsult30-Mar-10 14:13
mvePIEBALDconsult30-Mar-10 14:13 
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 14:22
skhan1730-Mar-10 14:22 
AnswerRe: Repositioning the cursor Pin
Alan N30-Mar-10 15:19
Alan N30-Mar-10 15:19 
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 15:38
skhan1730-Mar-10 15:38 
AnswerRe: Repositioning the cursor Pin
Som Shekhar30-Mar-10 18:38
Som Shekhar30-Mar-10 18:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.