private void panCols_DragDrop(object sender, DragEventArgs e) { QueryDesignDrapDropColumn obj = (QueryDesignDrapDropColumn)e.Data.GetData(typeof(QueryDesignDrapDropColumn)); if (obj != null && m_hightlightedColName >= 0) { m_frame.AddJoin(obj.Frame, obj.Column, this, m_table.Columns[m_hightlightedColName].ColumnName, true); } }
private void panCols_DragOver(object sender, DragEventArgs e) { QueryDesignDrapDropColumn obj = (QueryDesignDrapDropColumn)e.Data.GetData(typeof(QueryDesignDrapDropColumn)); if (obj != null) { if (obj.Frame == this) { e.Effect = DragDropEffects.None; return; } Point pt = panCols.PointToClient(new Point(e.X, e.Y)); int idx = pt.Y / m_lineHeight; if (idx >= 0 && idx < m_table.Columns.Count) { m_hightlightedColName = idx; e.Effect = DragDropEffects.Copy; panCols.Invalidate(); } } }