tabcontrol

What's the easiest way to clone a TabItem in WPF?

巧了我就是萌 提交于 2019-12-11 12:13:15
问题 I have the need to clone all of the contents of a tab to reflect the current state of a WPF TabItem, fully preserving all the bindings. The requirement is that each Tab should function independently with its own group of identical controls. I've so far only managed to create blank tabs. MSDN suggests this isn't possible. Seems like pretty basic functionality for MS to miss, so is this possible? // locate the TabControl that the tab will be added to TabControl itemsTab = (TabControl) this

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

How do you navigate a complex Visual Tree in order to re-bind an existing element?

时光毁灭记忆、已成空白 提交于 2019-12-11 11:08:32
问题 In the above image, child is a ContentPresenter. Its Content is a ViewModel. However, its ContentTemplate is null. In my XAML, I have a TabControl with the following structure: <local:SuperTabControlEx DataContext="{Binding WorkSpaceListViewModel}" x:Name="superTabControl1" CloseButtonVisibility="Visible" TabStyle="OneNote2007" ClipToBounds="False" ContentInnerBorderBrush="Red" FontSize="24" > <local:SuperTabControlEx.ItemsSource> <Binding Path="WorkSpaceViewModels" /> </local

Drag and detach tabpages

假如想象 提交于 2019-12-11 08:51:29
问题 I have several tabpages on a single tab control and I was wondering if anyone out there knows how I can program a way to drag tabpages off the tab control and into their own "form"....pulling the tabcontrol apart? I'm using vb.net and did find many ways to move the order of tabpages on the tabcontrol but non om how to actually detach the tabpage and place \ drag it elsewhere on the screen? 回答1: Assuming WinForms, essentially you have to create a new Form and a new TabControl to house the

How to handle a double click on a TabControl's tabs panel's empty space?

£可爱£侵袭症+ 提交于 2019-12-11 07:27:50
问题 In a TabControl there can be empty place to the right from tabs in the panel if there are not too many tabs. When a user doubleclicks in this empty space I'd like to process this event to create a new tab. How to achieve this? 回答1: This doesn't sound like a UI concept that's intuitive to the users of your application. Why don't you add a small additional tab labelled "+". When the user clicks on that tab, the full tab is added. Firefox does it that why and it was intuitive to me from the

WPF - Inherit TabControl and customize the style

血红的双手。 提交于 2019-12-11 07:22:49
问题 I want to inherit the default TabControl and handle the event double-click TabItem Header. This is XAML file: <local:MyTabControl x:Class="MyTabControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:CustomizedTabControl" mc:Ignorable="d"> <local:MyTabControl

Adding the same Panel to multiple TabPages

孤街醉人 提交于 2019-12-11 06:01:14
问题 In my previous question I could add a design time panel to a tab page at run time and my code looks like this and it works Ok. tabControl1.SuspendLayout(); tabControl1.TabPages[0].Controls.Add(panel1); tabControl1.ResumeLayout(); but now I need to do something like this: tabControl1.SuspendLayout(); tabControl1.TabPages[0].Controls.Add(panel1); tabControl1.TabPages[1].Controls.Add(panel1); tabControl1.TabPages[2].Controls.Add(panel1); tabControl1.ResumeLayout(); which just at run-time I can

How to show an ErrorProvider error icon next to a TabPage header?

≡放荡痞女 提交于 2019-12-11 05:51:43
问题 Edit: This is not a duplicate of Icons in TabControl C# - How?. The question there is about adding icons to tab pages. Here it is about how the change the error provider error icon position to be inside the header instead of to the right of the tab page itself. Also, the error provider error icon has the functionality that when you hover the mouse on it, you see the error text, which you do not see if you simply add an icon to the header. I have a form with a TabControl . The form has also an

Set tab control style on managed TabControl

爷,独闯天下 提交于 2019-12-11 05:41:17
问题 Is it possible to set a tab control style like TSC_BUTTONS on a managed TabControl? Windows CE 6 / .NET CF 3.5 回答1: With the caveat that I'm not specifically done this style change (though I've done plenty of others), according to the docs TCS_BUTTONS is a supported style. Since the managed TabControl is simply a wrapper around the native one, you should be able to P/Invoke SetWindowLong with GWL_STYLE and adjust this (probably in the constructor of a TabControl-derived custom control). 回答2:

Add icons to the tabs of a Firemonkey TTabControl

≯℡__Kan透↙ 提交于 2019-12-11 03:45:19
问题 To add an icon to a TButton in Firemonkey one can add a TImage to the button. But how to add an icon to a tab of a TTabControl? Is this possible? 回答1: At the very least you'll need to modify the style (to add the image) and probably create a custom control descended from TTabControl to set the image data. 来源: https://stackoverflow.com/questions/15550494/add-icons-to-the-tabs-of-a-firemonkey-ttabcontrol