<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FImageList</id>
		<title>Csharp/C Sharp/GUI Windows Form/ImageList - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FImageList"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ImageList&amp;action=history"/>
		<updated>2026-04-29T15:18:37Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ImageList&amp;diff=58&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ImageList&amp;diff=58&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ImageList&amp;diff=59&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ImageList&amp;diff=59&amp;oldid=prev"/>
				<updated>2010-05-26T11:32:48Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Add to and get Image from Image List==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.IO;&lt;br /&gt;
public class Form1 : Form&lt;br /&gt;
{&lt;br /&gt;
    private System.Windows.Forms.Button cmdFillImageList;&lt;br /&gt;
    private System.Windows.Forms.Button cmdPaintImages;&lt;br /&gt;
    private System.Windows.Forms.ImageList iconImages;&lt;br /&gt;
  public Form1() {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
    private void cmdFillImageList_Click(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        iconImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;&lt;br /&gt;
        iconImages.ImageSize = new System.Drawing.Size(16, 16);&lt;br /&gt;
        string[] iconFiles = Directory.GetFiles(Application.StartupPath, &amp;quot;*.ico&amp;quot;);&lt;br /&gt;
        foreach (string iconFile in iconFiles)&lt;br /&gt;
        {&lt;br /&gt;
            Icon newIcon = new Icon(iconFile);&lt;br /&gt;
            iconImages.Images.Add(newIcon);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private void cmdPaintImages_Click(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        Graphics g = this.CreateGraphics();&lt;br /&gt;
        for (int i = 0; i &amp;lt; iconImages.Images.Count; i++)&lt;br /&gt;
        {&lt;br /&gt;
            iconImages.Draw(g, 30 + i * 30, 30, i);&lt;br /&gt;
        }&lt;br /&gt;
        g.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
        this.cmdFillImageList = new System.Windows.Forms.Button();&lt;br /&gt;
        this.cmdPaintImages = new System.Windows.Forms.Button();&lt;br /&gt;
        this.iconImages = new System.Windows.Forms.ImageList(new System.ruponentModel.Container());&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        // &lt;br /&gt;
        // cmdFillImageList&lt;br /&gt;
        // &lt;br /&gt;
        this.cmdFillImageList.Location = new System.Drawing.Point(29, 217);&lt;br /&gt;
        this.cmdFillImageList.Name = &amp;quot;cmdFillImageList&amp;quot;;&lt;br /&gt;
        this.cmdFillImageList.Size = new System.Drawing.Size(118, 23);&lt;br /&gt;
        this.cmdFillImageList.TabIndex = 0;&lt;br /&gt;
        this.cmdFillImageList.Text = &amp;quot;Fill Image List&amp;quot;;&lt;br /&gt;
        this.cmdFillImageList.UseVisualStyleBackColor = true;&lt;br /&gt;
        this.cmdFillImageList.Click += new System.EventHandler(this.cmdFillImageList_Click);&lt;br /&gt;
        // &lt;br /&gt;
        // cmdPaintImages&lt;br /&gt;
        // &lt;br /&gt;
        this.cmdPaintImages.Location = new System.Drawing.Point(153, 217);&lt;br /&gt;
        this.cmdPaintImages.Name = &amp;quot;cmdPaintImages&amp;quot;;&lt;br /&gt;
        this.cmdPaintImages.Size = new System.Drawing.Size(112, 23);&lt;br /&gt;
        this.cmdPaintImages.TabIndex = 1;&lt;br /&gt;
        this.cmdPaintImages.Text = &amp;quot;Paint Images&amp;quot;;&lt;br /&gt;
        this.cmdPaintImages.UseVisualStyleBackColor = true;&lt;br /&gt;
        this.cmdPaintImages.Click += new System.EventHandler(this.cmdPaintImages_Click);&lt;br /&gt;
        // &lt;br /&gt;
        // iconImages&lt;br /&gt;
        // &lt;br /&gt;
        this.iconImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;&lt;br /&gt;
        this.iconImages.ImageSize = new System.Drawing.Size(16, 16);&lt;br /&gt;
        this.iconImages.TransparentColor = System.Drawing.Color.Transparent;&lt;br /&gt;
        // &lt;br /&gt;
        // ImageListTest&lt;br /&gt;
        // &lt;br /&gt;
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
        this.ClientSize = new System.Drawing.Size(292, 266);&lt;br /&gt;
        this.Controls.Add(this.cmdPaintImages);&lt;br /&gt;
        this.Controls.Add(this.cmdFillImageList);&lt;br /&gt;
        this.Font = new System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));&lt;br /&gt;
        this.Name = &amp;quot;ImageListTest&amp;quot;;&lt;br /&gt;
        this.Text = &amp;quot;ImageListTest&amp;quot;;&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    Application.EnableVisualStyles();&lt;br /&gt;
    Application.Run(new Form1());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Image List Example==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
User Interfaces in C#: Windows Forms and Custom Controls&lt;br /&gt;
by Matthew MacDonald&lt;br /&gt;
Publisher: Apress&lt;br /&gt;
ISBN: 1590590457&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing.Drawing2D;&lt;br /&gt;
using System.IO;&lt;br /&gt;
namespace ImageListExample&lt;br /&gt;
{&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;&lt;br /&gt;
  /// Summary description for ImageListExample.&lt;br /&gt;
  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
  public class ImageListExample : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    internal System.Windows.Forms.Button cmdDrawImageList;&lt;br /&gt;
    internal System.Windows.Forms.Button cmdFillImageList;&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Required designer variable.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private System.ruponentModel.Container components = null;&lt;br /&gt;
    public ImageListExample()&lt;br /&gt;
    {&lt;br /&gt;
      //&lt;br /&gt;
      // Required for Windows Form Designer support&lt;br /&gt;
      //&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      //&lt;br /&gt;
      // TODO: Add any constructor code after InitializeComponent call&lt;br /&gt;
      //&lt;br /&gt;
    }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Clean up any resources being used.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    protected override void Dispose( bool disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if( disposing )&lt;br /&gt;
      {&lt;br /&gt;
        if (components != null) &lt;br /&gt;
        {&lt;br /&gt;
          components.Dispose();&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      base.Dispose( disposing );&lt;br /&gt;
    }&lt;br /&gt;
    #region Windows Form Designer generated code&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Required method for Designer support - do not modify&lt;br /&gt;
    /// the contents of this method with the code editor.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.cmdDrawImageList = new System.Windows.Forms.Button();&lt;br /&gt;
      this.cmdFillImageList = new System.Windows.Forms.Button();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // cmdDrawImageList&lt;br /&gt;
      // &lt;br /&gt;
      this.cmdDrawImageList.FlatStyle = System.Windows.Forms.FlatStyle.System;&lt;br /&gt;
      this.cmdDrawImageList.Location = new System.Drawing.Point(164, 172);&lt;br /&gt;
      this.cmdDrawImageList.Name = &amp;quot;cmdDrawImageList&amp;quot;;&lt;br /&gt;
      this.cmdDrawImageList.Size = new System.Drawing.Size(96, 24);&lt;br /&gt;
      this.cmdDrawImageList.TabIndex = 3;&lt;br /&gt;
      this.cmdDrawImageList.Text = &amp;quot;Draw Images&amp;quot;;&lt;br /&gt;
      this.cmdDrawImageList.Click += new System.EventHandler(this.cmdDrawImageList_Click);&lt;br /&gt;
      // &lt;br /&gt;
      // cmdFillImageList&lt;br /&gt;
      // &lt;br /&gt;
      this.cmdFillImageList.FlatStyle = System.Windows.Forms.FlatStyle.System;&lt;br /&gt;
      this.cmdFillImageList.Location = new System.Drawing.Point(28, 172);&lt;br /&gt;
      this.cmdFillImageList.Name = &amp;quot;cmdFillImageList&amp;quot;;&lt;br /&gt;
      this.cmdFillImageList.Size = new System.Drawing.Size(104, 24);&lt;br /&gt;
      this.cmdFillImageList.TabIndex = 2;&lt;br /&gt;
      this.cmdFillImageList.Text = &amp;quot;Fill ImageList&amp;quot;;&lt;br /&gt;
      this.cmdFillImageList.Click += new System.EventHandler(this.cmdFillImageList_Click);&lt;br /&gt;
      // &lt;br /&gt;
      // ImageListExample&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(292, 214);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.cmdDrawImageList,&lt;br /&gt;
                                      this.cmdFillImageList});&lt;br /&gt;
      this.Name = &amp;quot;ImageListExample&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;ImageList Example&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    #endregion&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// The main entry point for the application.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new ImageListExample());&lt;br /&gt;
    }&lt;br /&gt;
    ImageList iconImages = new System.Windows.Forms.ImageList();&lt;br /&gt;
    private void cmdFillImageList_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      // Configure the ImageList.&lt;br /&gt;
      iconImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;&lt;br /&gt;
      iconImages.ImageSize = new System.Drawing.Size(16, 16);&lt;br /&gt;
      &lt;br /&gt;
      // Get all the icon files in the current directory.&lt;br /&gt;
        string[] iconFiles = Directory.GetFiles(Application.StartupPath, &amp;quot;*.ico&amp;quot;);&lt;br /&gt;
      &lt;br /&gt;
      // Create an Image object for each file and add it to the ImageList.&lt;br /&gt;
      // You can also use an Image subclass (like Icon).&lt;br /&gt;
      foreach (string iconFile in iconFiles)&lt;br /&gt;
      {&lt;br /&gt;
        Icon newIcon = new Icon(iconFile);&lt;br /&gt;
        iconImages.Images.Add(newIcon);&lt;br /&gt;
      }&lt;br /&gt;
         }&lt;br /&gt;
    private void cmdDrawImageList_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      // Get the graphics device context for the form.&lt;br /&gt;
      Graphics g = this.CreateGraphics();&lt;br /&gt;
      &lt;br /&gt;
      // Draw each image using the ImageList.Draw() method.&lt;br /&gt;
      for (int i = 0; i &amp;lt; iconImages.Images.Count; i++)&lt;br /&gt;
      {&lt;br /&gt;
        iconImages.Draw(g, 30 + i * 30, 30, i);&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      // Release the graphics device context.&lt;br /&gt;
      g.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.nfex.ru/Code/CSharpDownload/ImageListExample.zip&amp;quot;&amp;gt;ImageListExample.zip( 24 k)&amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>