Hi Folks,
I am writing a windows forms application. In this application I have a config(xml) file which contains the information about the controls.
See the sample below. I want to be able to draw these controls from this xml file. also the code should be flexible enough to draw any new control i add to my xml file.
control type="Label" id="label1" width="23" height="23" xPos="117" yPos="100"
control type="TextBox" id="textBox1" multiline="false" width="143" height="23" xPos="117" yPos="50"
control type="Button" id="button1" width="23" height="23" xPos="100" yPos="100"
Your help will be much appreciated.
Loading
WillPosted Feb 21, 2007, 9:42 AM
or
Instead of using your own format for the XML file, use a DataSet.WriteXML and DataSet.ReadXML.
This stores a table in XML format, which is fairly simple to use and add to manually.
All you have to do is call ReadXML() at the beginning of your program, and the data table that comes out is very easy to parse.
i.e. dsMyDataSet.Tables[0].Rows[0].ItemArray[0]; is the first element.
I would suggest including a primary key value, makes it easier to determine when you've hit the end of your table.
Good luck!
msxPosted Feb 13, 2007, 7:04 PM