I want to replace the string in my application..
i have used two form. one have my text and second form for find and replace..
using these two form how do i replace string?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
EhteshamPosted May 11, 2012, 2:15 AM
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
internal string StrVariable = string.Empty;
private void button1_Click(object sender, EventArgs e)
{
using (Form2 FrmObj = new Form2(this))
{
FrmObj.ShowDialog();
}
}
}
-------------------------------------------------------------
public partial class Form2 : Form
{
Form1 FrmRef;
public Form2()
{
InitializeComponent();
}
public Form2(Form1 frmref)
: this()
{
this.FrmRef = frmref;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
this.FrmRef.StrVariable = this.textBox1.Text;
}
}