43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| namespace FCOMMON
 | |
| {
 | |
|     public partial class fSelectMonth : Form
 | |
|     {
 | |
|         public int selectmon { get; set; }
 | |
|         public fSelectMonth()
 | |
|         {
 | |
|             InitializeComponent();
 | |
|             selectmon = -1;
 | |
|             this.KeyDown += (s1,e1)=>{ if (e1.KeyCode == Keys.Escape) this.Close(); };
 | |
|         }
 | |
| 
 | |
|         private void fSelectMonth_Load(object sender, EventArgs e)
 | |
|         {
 | |
|              for(int i = 1 ; i <=12;i++)
 | |
|              {
 | |
|                  Button newbt = new Button();
 | |
|                  newbt.Text = string.Format("{0}월",i);
 | |
|                  newbt.Tag = i;
 | |
|                  newbt.Click += newbt_Click;
 | |
|                  newbt.Dock = DockStyle.Fill;
 | |
|                  tableLayoutPanel1.Controls.Add(newbt);
 | |
|              }
 | |
|         }
 | |
| 
 | |
|         void newbt_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             var bt = sender as Button;
 | |
|             selectmon = int.Parse(bt.Tag.ToString());
 | |
|             DialogResult = System.Windows.Forms.DialogResult.OK;
 | |
|         }
 | |
|     }
 | |
| }
 | 
