Creating edit boxes after reading a XML file

I'm new to C# and still learning. I have one question:

I have a XML file that describes several fields. For each field a edit box needs to
get displayed on a form.

How can i create edit boxes in runtime

Kind regards,




Answer this question

Creating edit boxes after reading a XML file

  • RebEl

    You probably want to look at XML Deserialization.

    After you get the XML data into an object, you just do something like



    foreach(Data data in XMLData){
        Field tmp = new Field();
        tmp.Text = data.something;
        MyPanel.Controls.Add(tmp);
    }

     


    Of course, you would actually write real code with real classes as apposed to my pseudo codish stuff.

    Hope that helped,
    Aditya

  • Creating edit boxes after reading a XML file