49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using AR;
 | |
| 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 Project.Dialog
 | |
| {
 | |
|     public partial class fSelectDataList : Form
 | |
|     {
 | |
|         public string SelectedValue = string.Empty;
 | |
|         public fSelectDataList(string[] list)
 | |
|         {
 | |
|             InitializeComponent();
 | |
|             this.listBox1.Items.Clear();
 | |
|             foreach (var item in list)
 | |
|                 this.listBox1.Items.Add(item);
 | |
|             this.KeyDown += FSelectDataList_KeyDown;
 | |
|         }
 | |
| 
 | |
|         private void FSelectDataList_KeyDown(object sender, KeyEventArgs e)
 | |
|         {
 | |
|             if (e.KeyCode == Keys.Escape) this.Close();
 | |
|         }
 | |
| 
 | |
|         private void fSelectDataList_Load(object sender, EventArgs e)
 | |
|         {
 | |
| 
 | |
|         }
 | |
| 
 | |
|         private void button1_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             if (this.listBox1.SelectedIndex < 0)
 | |
|             {
 | |
|                 UTIL.MsgE("아이템을 선택하세요\n\n취소하려면 ESC키 혹은 닫기 버튼을 누르세요");
 | |
|                 return;
 | |
|             }
 | |
|             this.SelectedValue = this.listBox1.Items[this.listBox1.SelectedIndex].ToString();
 | |
|             this.DialogResult = DialogResult.OK;
 | |
| 
 | |
|         }
 | |
|     }
 | |
| }
 | 
