Click here to Skip to main content
15,884,298 members
Articles / Programming Languages / C#

MyXAML--XAML-style gui generator (added styles)

Rate me:
Please Sign up or sign in to vote.
4.85/5 (76 votes)
9 Mar 2004CPOL11 min read 395K   165  
Generate controls, set property values, and wire up event handlers at runtime from an XML definition.
<?xml version="1.0" encoding="utf-8"?>
<UI xmlns="System.Windows.Forms, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    xmlns:def="Definition">
	<Canvas Name='Form1' FormBase='Form' AutoScaleBaseSize='5, 13' ClientSize='680, 590' Text='Form1' >
		<Controls>
			<TextBox Location='136, 8' Name='textBox1' TabIndex='3' Text='textBox1' />
			<CheckBox Location='280, 16' Name='checkBox1' TabIndex='4' Text='checkBox1' />
			<VScrollBar Location='520, 104' Name='vScrollBar1' Size='17, 104' TabIndex='17' />
			<LinkLabel Location='16, 32' Name='linkLabel1' TabIndex='1' TabStop='true' Text='linkLabel1' />
			<HScrollBar Location='312, 208' Name='hScrollBar1' Size='200, 17' TabIndex='16' />
			<CheckBox Location='280, 40' Name='checkBox2' TabIndex='5' Text='checkBox2' />
			<Panel BorderStyle='Fixed3D' Location='312, 104' Name='panel1' TabIndex='9' />
			<NumericUpDown Location='224, 416' Name='numericUpDown1' TabIndex='19' />
			<TreeView ImageIndex='-1' Location='440, 256' Name='treeView1' SelectedImageIndex='-1' TabIndex='13' />
			<Label Font='Comic Sans MS,  15pt, style=Bold, Underline' Location='112, 48' Name='label1' Size='144, 32' TabIndex='0' Text='Clowns R Us' />
			<ProgressBar Location='224, 496' Name='progressBar1' Size='176, 23' TabIndex='21' />
			<DomainUpDown Location='224, 384' Name='domainUpDown1' Size='168, 20' TabIndex='18' Text='domainUpDown1' />
			<GroupBox Location='32, 112' Name='groupBox1' TabIndex='8' TabStop='false' Text='groupBox1' />
			<MonthCalendar Location='16, 416' Name='monthCalendar1' TabIndex='15' />
			<DateTimePicker Location='16, 384' Name='dateTimePicker1' TabIndex='14' />
			<ComboBox Location='176, 256' Name='comboBox1' Size='121, 21' TabIndex='11' Text='comboBox1' />
			<Button Location='16, 56' Name='button1' TabIndex='2' Text='button1' />
			<ListBox Location='40, 256' Name='listBox1' Size='120, 95' TabIndex='10' />
			<TrackBar Location='224, 440' Name='trackBar1' Size='176, 45' TabIndex='20' />
			<RadioButton Location='392, 16' Name='radioButton1' TabIndex='6' Text='radioButton1' />
			<RadioButton Location='392, 40' Name='radioButton2' TabIndex='7' Text='radioButton2' />
			<ListView Location='312, 256' Name='listView1' TabIndex='12' />

		</Controls>
	</Canvas>
</UI>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Interacx
United States United States
Blog: https://marcclifton.wordpress.com/
Home Page: http://www.marcclifton.com
Research: http://www.higherorderprogramming.com/
GitHub: https://github.com/cliftonm

All my life I have been passionate about architecture / software design, as this is the cornerstone to a maintainable and extensible application. As such, I have enjoyed exploring some crazy ideas and discovering that they are not so crazy after all. I also love writing about my ideas and seeing the community response. As a consultant, I've enjoyed working in a wide range of industries such as aerospace, boatyard management, remote sensing, emergency services / data management, and casino operations. I've done a variety of pro-bono work non-profit organizations related to nature conservancy, drug recovery and women's health.

Comments and Discussions