PDA

Click to See Complete Forum and Search --> : form.show problem


King Abadon
May 11th, 2007, 03:17 AM
i have to make a pocket aplication
i read from an xml file and i modify some data

private void button1_Click(object sender, EventArgs e)
{
System.Data.DataSet DSet = new DataSet();
DSet.ReadXml("Employee.xml");
dataGrid1.DataSource = DSet.Tables[0];
}
private void button2_Click(object sender, EventArgs e)
{
Form1 Form2 = new Form1();
Form2.Show();//using ShowDialog is teh same
Form2.Activate();

the problem is i cant switch to form2 where i have a textbox and a buton
and if you can please tell me how i can insert the value in the dataset


Sr for so many questions but i'm a rookie with C#

Paul M
May 11th, 2007, 03:34 AM
I don't use C# much but Form2.ShowDialog
Maybe?

Shuja Ali
May 11th, 2007, 04:51 AM
The code for initializing Form2 and showing it would be Form2 newForm= new Form2();
newForm.Show();
newForm.Activate();

ComputerJy
May 11th, 2007, 02:36 PM
The code for initializing Form2 and showing it would be Form2 newForm= new Form2();
newForm.Show();
newForm.Activate();
That'd be right if there was a Form2 class.
And by the way, you don't have to use newForm.Activate(); because it's called from the inside of Form.Show()