![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | ComboBox Padding in Feb CTP Breaks Jan CTP Behavior In the Jan CTP, we were able to make comboboxes short (like 16, but with default font) and if the style included VerticalAlignment="Center" we could see the selected text centered vertically. With Feb CTP the text is cut off at the bottom. It's like the top is padded even though we've set the top and bottom padding to zero. Does anyone know of a workaround for this? To see this problem first hand, paste the XAML below into the Feb CTP version of XAMLPad. Do I need to create a control template to work around this new bug? If so, can someone provide a sample of how to create a control template just for the selected text part of a combobox? ItemTemplate does not affect the selected text box portion of a ComboBox. Thanks! Erik For XAMLPad: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Page.Resources> <Style TargetType="{x:Type ComboBox}" x:Key="DropDownStyle"> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Padding" Value="1,0,1,0" /> <Setter Property="Margin" Value="0" /> <Setter Property="Height" Value="16" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Width" Value="100" /> </Style> </Page.Resources> <Grid> <ComboBox Style="{StaticResource DropDownStyle}" SelectedIndex="1"> <ComboBoxItem>Entry One</ComboBoxItem> <ComboBoxItem>Entry Two</ComboBoxItem> <ComboBoxItem>Entry Three</ComboBoxItem> </ComboBox> </Grid> </Page> |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: ComboBox Padding in Feb CTP Breaks Jan CTP Behavior I just found a workaround minutes after posting this. The workaround is bizarre but seems to work. I just have to set the Padding to a negative number. <Setter Property="Padding" Value="1,-2,1,0" /> The -2 actually works! I'm still interested in finding out if this is listed as a bug to be fixed in Beta 2? Thanks. Erik "Erik Thomas" wrote: > In the Jan CTP, we were able to make comboboxes short (like 16, but with > default font) and if the style included VerticalAlignment="Center" we could > see the selected text centered vertically. With Feb CTP the text is cut off > at the bottom. It's like the top is padded even though we've set the top and > bottom padding to zero. > > Does anyone know of a workaround for this? > > To see this problem first hand, paste the XAML below into the Feb CTP > version of XAMLPad. > > Do I need to create a control template to work around this new bug? If so, > can someone provide a sample of how to create a control template just for the > selected text part of a combobox? ItemTemplate does not affect the selected > text box portion of a ComboBox. > > Thanks! > > Erik > > For XAMLPad: > > <Page > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > > <Page.Resources> > <Style TargetType="{x:Type ComboBox}" x:Key="DropDownStyle"> > <Setter Property="BorderThickness" Value="0" /> > <Setter Property="Padding" Value="1,0,1,0" /> > <Setter Property="Margin" Value="0" /> > <Setter Property="Height" Value="16" /> > <Setter Property="VerticalAlignment" Value="Center" /> > <Setter Property="Width" Value="100" /> > </Style> > </Page.Resources> > <Grid> > <ComboBox Style="{StaticResource DropDownStyle}" SelectedIndex="1"> > <ComboBoxItem>Entry One</ComboBoxItem> > <ComboBoxItem>Entry Two</ComboBoxItem> > <ComboBoxItem>Entry Three</ComboBoxItem> > </ComboBox> > </Grid> > </Page> |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom Combobox in WPF | askaile | Avalon | 2 | 09-24-2007 02:47 AM |
| reduce padding in StackPanel | John Taylor | Avalon | 1 | 08-26-2007 04:21 PM |
| ComboBox Problem | Bahadýr ARSLAN | Avalon | 6 | 08-26-2007 04:17 PM |
| Smart-quote behavior: Is current behavior ideal? | Alex K. Angelopoulos [MVP] | PowerShell | 0 | 08-16-2006 01:39 PM |
| combobox-transperent | crish | Avalon | 0 | 03-08-2006 06:11 AM |