private void tablePanel1_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(TreeNode))) { TreeNode tn = e.Data.GetData(typeof(TreeNode)) as TreeNode; if (tn != null && tn.Tag is TableData) { FrmTable frm = new FrmTable(tn.Tag as TableData); frm.MdiParent = this; frm.Location = tablePanel1.PointToClient(new Point(e.X, e.Y)); this.tablePanel1.Controls.Add(frm); frm.Show(); } } }