using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication25
{
    public partial class choosefaces : Form
    {

        public choosefaces()
        {
            InitializeComponent();
        }
        //取消
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

       
        //单击确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (lvFaces.SelectedItems.Count < 1)
                MessageBox.Show("请选择一个头像!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
            {
                ID.faceId = lvFaces.SelectedItems[0].ImageIndex;
                this.Close();
            }

        }
        //窗体加载
        private void choosefaces_Load(object sender, EventArgs e)
        {
            skinEngine1.SkinFile = "MSN.ssk"; 
            for (int i = 0; i < ilFaces.Images.Count; i++)
            {
                lvFaces.Items.Add(i.ToString());
                lvFaces.Items[i].ImageIndex = i;
            }
            
        }

        private void choosefaces_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lvFaces.SelectedItems.Count < 1)
                MessageBox.Show("请选择一个头像!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
            {
               ID.faceId= lvFaces.SelectedItems[0].ImageIndex;
               this.Close();
            }
        }


    } 
}