开发者

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

I would like to implement drag 'n drop with a tabcontrol in a way that dragg开发者_如何学运维ing an item to tag strip brings it to front. Which is the most efficient and non obtrusive way?

Thank you


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜