Reputation: 3858
I would like to implement drag 'n drop with a tabcontrol in a way that dragging an item to tag strip brings it to front. Which is the most efficient and non obtrusive way?
Thank you
Upvotes: 1
Views: 1865
Reputation: 14517
private void TabControl_DragEnter(object sender, DragEventArgs e)
{
TabItem item = e.Source as TabItem;
TabControl tabControl = sender as TabControl;
if (item != null && tabControl != null)
{
if (tabControl.SelectedItem != item)
tabControl.SelectedItem = item;
}
}
Upvotes: 2