private void ClickEvent(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { target = (ResizeablePanel)sender; contextMenuStrip2.Show(PointToScreen(e.Location)); } }
private void 필드추가ToolStripMenuItem_Click(object sender, EventArgs e) { if (initFieldStack.Count > 0) { ResizeablePanel panel = initFieldStack.Pop(); panel.Visible = true; fieldList.AddLast(panel); } }
public Form1() { initFieldStack = new Stack <ResizeablePanel>(); fieldList = new LinkedList <ResizeablePanel>(); InitializeComponent(); for (int i = 0; i < 10; i++) { ResizeablePanel resizeablePanel = new ResizeablePanel(initFieldStack, fieldList); initFieldStack.Push(resizeablePanel); this.pictureBox1.Controls.Add(resizeablePanel); } foreach (ResizeablePanel penal in initFieldStack) { penal.setPictureBox1(pictureBox1); } openFileDialog1.Multiselect = false; openFileDialog1.Filter = "jpg|*.jpg"; openFileDialog1.DefaultExt = ".jpg"; pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; }