Click here to Skip to main content
15,896,444 members
Articles / Programming Languages / C#

Visual Style Element Browser

Rate me:
Please Sign up or sign in to vote.
4.84/5 (19 votes)
12 Feb 2008CPOL1 min read 64.3K   4.7K   81  
A simple tree which exposes the different VisualStyleElements available in NET 2.0
using System;
using System.Collections.Generic;
using System.Text;

namespace CommonTools
{
	public class NameObject<T>
	{
		public string m_name = string.Empty;
		public string Name
		{
			get { return m_name; }
			set { m_name = value; }
		}
		public T m_object;
		public T Object
		{
			get { return m_object; }
			set { m_object = value; }
		}
		public NameObject(string name, T obj)
		{
			Name = name;
			Object = obj;
		}
		public override string ToString()
		{
			return Name;
		}
	}
	public class NameObjectCollection<T> : List<NameObject<T> >
	{
		public void Add(string name, T value)
		{
			Add(new NameObject<T>(name, value));
		}
		public NameObject<T> FindValue(T value)
		{
			foreach(NameObject<T> item in this)
			{
				if (item.Object.Equals(value))
					return item;
			}
			return null;
		}
	}
}

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
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions