private void selectPanel_DragDrop(object sender, DragEventArgs e) { // ドラッグできるアイテムが存在するかチェックします。 if (e.Data.GetDataPresent(typeof(ListViewItem))) { ListViewItem srcItem = (ListViewItem)e.Data.GetData(typeof(ListViewItem)); Point p = this.selectPanel.PointToClient(new Point(e.X, e.Y)); //同一写真が開かれているときはreturn foreach (Photo_form pf in selectPanel.Controls) { if (pf.imgName == this.imageList1.Images.Keys[srcItem.ImageIndex]) { return; } } Photo_form f1 = new Photo_form(this, this.imageList1.Images.Keys[srcItem.ImageIndex]); f1.TopLevel = false; f1.Location = p; selectPanel.Controls.Add(f1); selectPanel.Controls.SetChildIndex(f1, 0); f1.Show(); } }
private void b_spread_Click(object sender, EventArgs e) { this.photo_Selection.selectPanel.Controls.Clear(); foreach (ListViewItem srcItem in this.thumbnailList.Items) { Photo_form f1 = new Photo_form(this.photo_Selection, this.imageList1.Images.Keys[srcItem.ImageIndex]); f1.TopLevel = false; this.photo_Selection.selectPanel.Controls.Add(f1); this.photo_Selection.selectPanel.Controls.SetChildIndex(f1, 0); f1.Show(); } this.photo_Selection.arrange(); }
private List <Photo_form> getPhoto_formList() { List <Photo_form> Photo_formList = new List <Photo_form>(); foreach (Control con in this.selectPanel.Controls) { if (con.GetType() == typeof(Photo_form)) { Photo_form f = (Photo_form)con; if (f.checkBox1.Checked == true) { Photo_formList.Add(f); } } } return(Photo_formList); }