xaml (wpf) का उपयोग करके मैं नीचे "चित्रण ए" में दिखाए गए टैब नियंत्रण के नीचे रेखा से छुटकारा पाने की कोशिश कर रहा हूं ताकि यह दिखने लगे "चित्रण बी ':टैब नियंत्रण के उस टैब के नीचे लाइन से छुटकारा पाएं
चित्रण एक
http://www.arulerforwindows.com/images/peskylinea.png
चित्रण बी
http://www.arulerforwindows.com/images/peskylineb.png
गु ई लाइन तब दिखाई देती है जब मैं टैब आइटम को परिभाषित करता हूं लेकिन टैब नियंत्रण से जुड़ा हुआ प्रतीत होता है, जिसके परिणामस्वरूप या तो टैब आइटम या टैब कंट्रोल दोनों पर सीमाबद्धता बदलती है, वांछित परिणाम उत्पन्न नहीं होता है।
मुझे इसे एक पारदर्शी पृष्ठभूमि पर करने की आवश्यकता है जहां समस्या को मुखौटा करने के लिए एक ठोस भरने आयत का उपयोग नहीं किया जा सकता है।
कोड यह रहा:
<!--Tab Control-->
<Style TargetType="{x:Type TabControl}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel Name="HeaderPanel" Grid.Row="0" Panel.ZIndex="1" Margin="0,0,0,-1" IsItemsHost="True" KeyboardNavigation.TabIndex="1" Background="Transparent" />
<Border
Name="Border"
Grid.Row="1"
Background="{StaticResource WindowBackgroundBrush}"
BorderBrush="{StaticResource DefaultSystemBrush}"
BorderThickness="1,1,1,1"
Margin="0,0,0,0"
CornerRadius="4"
KeyboardNavigation.TabNavigation="Local"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2" >
<ContentPresenter
Name="PART_SelectedContentHost"
Margin="4"
ContentSource="SelectedContent" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
<Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource DisabledBorderBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid>
<Border Name="Border" Background="Transparent" BorderBrush="{StaticResource DefaultSystemBrush}" BorderThickness="1,1,1,1" CornerRadius="6,6,0,0">
<ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="12,2,12,2"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="100" />
<Setter TargetName="Border" Property="Background" Value="Transparent" />
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background" Value="LightGray" />
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
अग्रिम धन्यवाद,
रोब
मुझे कुछ याद आ रहा है, लेकिन टैबिटम के साथ डिफ़ॉल्ट टैब नियंत्रण आपके चित्रण में उस पंक्ति में नहीं होगा। क्या आप उन टैब के बारे में बात कर रहे हैं जिन्हें चुना नहीं गया है? Http://blog.paranoidferret.com/index.php/2008/01/18/the-wpf-tab-control-inside-and-out/ चित्र देखें, वहां रेखा नहीं दिखती है। – Jab
मैंने उसे भी देखा था। यदि आप बारीकी से देखते हैं तो पहले कुछ चित्रों में चयनित टैब के नीचे कोई रेखा नहीं है, लेकिन अंतिम कुछ (टैबिटम परिभाषित करने के बाद) उनके नीचे की रेखा है। – Rob
अब के लिए एक काम के रूप में मैं टैब नियंत्रण की शीर्ष सीमा को सेट कर रहा हूं, और टैब के दाएं किनारे और टैबcontrol कंटेनर के दाएं किनारे पर एक पिक्सेल चौड़ाई आयताकार जोड़ रहा हूं। एक शर्त तरीका होना चाहिए। – Rob