using System;
using System.Drawing;
using System.Windows.Forms;

namespace _ex_11_7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            imageList1.ImageSize = new Size(128, 128);
            //--------------------------------------------------------
            imageList1.ColorDepth = ColorDepth.Depth32Bit;
            //--------------------------------------------------------
            string sP = Application.StartupPath;
            //--------------------------------------------------------
            Image img1 = Image.FromFile(sP + @"\" + "Exit.png");
            imageList1.Images.Add(img1);
            //-------------------------------------------------------- 
            button1.Image = imageList1.Images[0];
            //button1.ImageList = imageList1;
            //button1.ImageIndex = 0;
            //--------------------------------------------------------
            button1.Size = new Size(250, 128); ;
            button1.ImageAlign = ContentAlignment.MiddleLeft;
            button1.TextAlign = ContentAlignment.MiddleRight;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}