Results 1 to 4 of 4

Thread: form.show problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    form.show problem

    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#
    Last edited by King Abadon; May 11th, 2007 at 03:38 AM.

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: form.show problem

    I don't use C# much but
    vb Code:
    1. Form2.ShowDialog
    Maybe?

  3. #3
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: form.show problem

    The code for initializing Form2 and showing it would be
    Code:
    Form2 newForm= new Form2();
    newForm.Show();
    newForm.Activate();
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: form.show problem

    Quote Originally Posted by Shuja Ali
    The code for initializing Form2 and showing it would be
    Code:
    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()
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width