tabcontrol

How to make Managed Tab Control (MTC) appear right to left

若如初见. 提交于 2019-12-25 18:47:22
问题 I have used this TabControl to create the following tablayout in a winform application How do i make the tabs appear right to left? I mean make it like this image I also tried to Use RightToLeftLayout property but this tab control doesn't have that property 回答1: It seems that MTC while affected by RightToLeft doesn't draw as expected (In part due to the fact that it statically draws the tabs from left to right and calculates width from the left): It's easy enough to do in WinForms: The secret

How to make Managed Tab Control (MTC) appear right to left

笑着哭i 提交于 2019-12-25 18:46:13
问题 I have used this TabControl to create the following tablayout in a winform application How do i make the tabs appear right to left? I mean make it like this image I also tried to Use RightToLeftLayout property but this tab control doesn't have that property 回答1: It seems that MTC while affected by RightToLeft doesn't draw as expected (In part due to the fact that it statically draws the tabs from left to right and calculates width from the left): It's easy enough to do in WinForms: The secret

How to make only the header of the tabitem respond to the mouse event

。_饼干妹妹 提交于 2019-12-25 16:51:00
问题 I'm trying to make only the header of the TabItem send an event. So far I have my xaml... <TabControl> <TabItem Header="tab 1"> Any text </TabItem> <TabItem Header="tab 2"> <TextBox>blah</TextBox> </TabItem> <TabControl.Resources> <Style TargetType="TabItem"> <EventSetter Event="MouseDoubleClick" Handler="TabItemMouseDoubleClick"/> </Style> </TabControl.Resources> </TabControl> ...and my event handler... void TabItemMouseDoubleClick(object sender, MouseButtonEventArgs e) {} Now, when double

TabControl - databinding TabItem order

我们两清 提交于 2019-12-25 08:20:12
问题 I've got a datababound TabControl and would like to bind the index of each TabItem to a corresponding property in my view model. The ItemsSource is an ObservableCollection, and I'm using Bea Stollnitz's Drag/Drop functionality to provide tab control re-ordering. My gut feeling is that it should be able to be handled in the data template for the tab item header, but I haven't been able to get it working. 回答1: Your TabControl.ItemsSource should be bound to your collection, so to re-arrange the

Binding properties (width/sorting) of DataGrid on dynamic TabPage

我只是一个虾纸丫 提交于 2019-12-25 07:09:31
问题 I've created a little wpf test project to demonstrate my question. This project contains a single wpf window. This window contains only a TabControl . The pages of this TabControl are created dynamically from the bound ItemSource . My XAML: <Window x:Name="window" x:Class="TestWpf.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:TestWpf" Title="MainWindow" Height="350" Width="525">

ListBox Selected Items are reset each time I switch tabs in may TabControl

泪湿孤枕 提交于 2019-12-25 04:50:13
问题 I have the following TabControl: <TabControl Name="tabControl" Grid.Row="0" MinWidth="270" HorizontalAlignment="Stretch" ItemsSource="{Binding Counters}" ContentTemplate="{StaticResource templateForTheContent}" ItemTemplate="{StaticResource templateForTheHeader}"> </TabControl> It uses this DataTemplate: <Window.Resources> <DataTemplate x:Key="templateForTheContent" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid

C# TabControl TabPage passing events

风格不统一 提交于 2019-12-25 02:59:10
问题 I am working with a TabControl and attaching TabPages to the TabControl, but am having a problem making one of the TabPages respond to an event. It makes me think that I am missing something about the relationship between these classes, so would appreciate some help. I want to add a number of TabPage objects to TabControl, and for one of them (the first one added), I want to send it an event to make it do something. Here is the basic code: /* tabControl is a TabControl object, and tabNames is

Customize TabPage tabs like Process Flow Arrows in Microsoft Dynamics CRM 2015

本小妞迷上赌 提交于 2019-12-24 16:29:58
问题 I want my TabControl in a Windows Forms app to look something like this: https://technet.microsoft.com/en-us/library/dn531164.aspx I have an app that has process flow and each TabPage is a process phase that I want to represent with these nice looking arrows. I know about OnPaint and System.Drawing, but I cannot make those tabs look decent. I tried to handle TabControl.DrawItem event and to draw an arrow, but I am not satisfied with the look. private void tabControl1_DrawItem(object sender,

How to make WPF TabItem Headers' Background transparent?

霸气de小男生 提交于 2019-12-24 14:28:37
问题 I have a TabControl with a few TabItems. Each TabItem has a Grid with a TextBlock and one Image, which has transparent areas, in it. My goal is to have the Text and the Image completely visible and see the Window.Background Image through the transparent areas. Problem: No matter what I tried, there is a white background behind the Image and TextBlock I have set. I tried to set the TabControl Opacity to 0, but that makes the whole thing dissapear, as expected. Same result with the TabItem

WPF: apply style only to one tabcontrol containing other tabControl

大憨熊 提交于 2019-12-24 12:43:46
问题 In my wpf application, I have a tabControl (parent) that contains another tabcontrol (child). I would like to apply a style to the tabItem of the parent tabControl without affecting the child one. I tried with this: <TabControl x:Name="Parent" TabStripPlacement="Left" ItemsSource="{Binding Path=ParentTabItems, Mode=OneWay}" > <TabControl.Resources> <Style TargetType="{x:Type TabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <!-- template is