WPF tab control drag 'n drop: bring tab in front behavior

萝らか妹 提交于 2019-12-11 11:16:34

问题


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


回答1:


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;
    }
}


来源:https://stackoverflow.com/questions/4439323/wpf-tab-control-drag-n-drop-bring-tab-in-front-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!