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

namespace FCOMMON
{
    public partial class fLOV : Form
    {
        public fLOV(string[] list,string defitem = "")
        {
            InitializeComponent();

            this.dv.Rows.Clear();
            foreach(var item in list)
            {
                dv.Rows.Add(new object[] { item });
            }
        }

        private void fLOV_Load(object sender, EventArgs e)
        {

        }

        private void arDatagridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            FeedBack();
        }

        private void btSelect_Click(object sender, EventArgs e)
        {
            FeedBack();
        }

        void FeedBack()
        {
            if (dv.SelectedCells.Count < 1) return;
            this.SelectedValue = dv.SelectedCells[0].Value.ToString();
            DialogResult = DialogResult.OK;
        }
        public string SelectedValue { get; set; }
    }
}
