views:

95

answers:

0

I have the following Style settings for a Silverlight PasswordBox:

<Style x:Key="s_DefaultPasswordBoxStyle" TargetType="PasswordBox">
  <Setter Property="Margin" Value="0,0,30,0"/>
  <Setter Property="BorderThickness" Value="1"/>
  <Setter Property="Background" Value="{StaticResource TitleBarForeSolidColorBrush}"/>
  <Setter Property="Foreground" Value="#FF000000"/>
  <Setter Property="Padding" Value="0"/>
  <Setter Property="BorderBrush" Value="{StaticResource DarkMainDesignColorBrush}" />
  <Setter Property="MinHeight" Value="24" />
  <Setter Property="MaxHeight" Value="24" />
  <Setter Property="VerticalAlignment" Value="Top" />
  <!-- Detailed template setter follows here -->
</Style>

The control itself looks like this:

<PasswordBox
  x:Name="PasswordConfirmation"
  Password="{Binding PasswordConfirmation, Mode=TwoWay}"
  Style="{StaticResource DefaultPasswordBoxStyle}"
  />

Currently the control displays with a vertical scroll bar which is practically useless and generally unwanted. I've tried hiding the scroll bar by both setting the property in the Style like this:

<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />

... or in the XAML file itself like this:

ScrollViewer.VerticalScrollBarVisibility="Hidden"

Both settings didn't do anything. I think setting it to "Auto" should be enough, but just in case I tried "Hidden" and still no change.

Does anybody have an idea what the issue might be here? It could also be that the way I set the properties is correct and something else is the issue, so I'd also appreciate if someone would confirm that this is the right way to set the scroll bar visibility for PasswordBox controls.