Boman

This is what I'am Talking about Smile

http://jens-christian-jensen.dk/bo/scrollbars.jpg

Where do I set the "cube" to be Transparent.

Best Regards

/Bo



Re: Windows Presentation Foundation (WPF) How to hide the 'cube' where the listboxes meet ?

JDPeckham

can't duplicate the problem, what is your xaml for this example






Re: Windows Presentation Foundation (WPF) How to hide the 'cube' where the listboxes meet ?

Boman

I have done like this .. I'am using the Vertical for the horisontal aswell .

Is this the right way to go Smile

Another thing is it possible to define / bind to a double / integer as the solidcolorbrushes

<Double x:Key="myInteger" Value="20"> ' I know you cant write this i Xaml but I guess it can be defined someway

So my setter value could be something like <Setter Property="Width" Value="{Binding myInteger}" />



<!--
Scrollbar Color -->

<SolidColorBrush x:Key="scroller_color" Color="#4CFFFFFF" />

<SolidColorBrush x:Key="scroller_bg_color" Color="#26FFFFFF" />


<!-- Scrollbar decrease -->

<Style x:Key="Decrease" TargetType="{x:Type RepeatButton}">

<Setter Property="Command" Value="ScrollBar.PageUpCommand" />
<
Setter Property="Template">

<Setter.Value>

<ControlTemplate>

<Border Background="Transparent" />

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

<!-- Scrollbar increase -->

<Style x:Key="Increase" TargetType="{x:Type RepeatButton}">

<Setter Property="Command" Value="ScrollBar.PageDownCommand" />

<Setter Property="Template">

<Setter.Value>

<ControlTemplate>
<
Border Background="Transparent" />
</
ControlTemplate>
</
Setter.Value>
</
Setter>
</
Style>

<!-- Scrollbar thumb -->
<
Style x:Key="Thumb" TargetType="{x:Type Thumb}">

<Setter Property="Cursor" Value="Hand" />

<Setter Property="Template">

<Setter.Value>

<ControlTemplate>

<Border CornerRadius="2" Background="{StaticResource scroller_color}" />

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

<!-- Scrollbar verticalbar .. ( horisontal )-->

<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">

<Grid >

<Grid.RowDefinitions>

<RowDefinition MaxHeight="0.0"/>

<RowDefinition Height="0.00001*"/>

<RowDefinition MaxHeight="0.0"/>

</Grid.RowDefinitions>

<Border

Grid.RowSpan="3"

CornerRadius="2"

Background="{StaticResource scroller_bg_color}" />

<RepeatButton

Grid.Row="0"

Height="0"

/>

<Track

Name="PART_Track"

Grid.Row="1"

IsDirectionReversed="true">

<Track.DecreaseRepeatButton>

<RepeatButton

Style="{StaticResource Decrease}"

Command="ScrollBar.PageUpCommand" />

</Track.DecreaseRepeatButton>

<Track.Thumb>

<Thumb Style="{StaticResource Thumb}" />

</Track.Thumb>

<Track.IncreaseRepeatButton>

<RepeatButton

Style="{StaticResource Increase}"

Command="ScrollBar.PageDownCommand" />

</Track.IncreaseRepeatButton>

</Track>

<RepeatButton

Grid.Row="3"

Height="0"

/>

</Grid>

</ControlTemplate>


<!-- Scrollbar Scrollbar -->

<Style TargetType="{x:Type ScrollBar}">

<Setter Property="SnapsToDevicePixels" Value="True"/>

<Setter Property="OverridesDefaultStyle" Value="true"/>

<Setter Property="Margin" Value="10,10,10,10"/>

<Style.Triggers>

<Trigger Property="Orientation" Value="Horizontal">

<Setter Property="Width" Value="Auto"/>

<Setter Property="Height" Value="4" />

<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />

</Trigger>

<Trigger Property="Orientation" Value="Vertical">

<Setter Property="Width" Value="4"/>

<Setter Property="Height" Value="Auto" />

<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />

</Trigger>

</Style.Triggers>

</Style>





Re: Windows Presentation Foundation (WPF) How to hide the 'cube' where the listboxes meet ?

Yi-Lun Luo - MSFT

Hello, you can create a ControlTemplate for ScrollViewer. The default ScrollViewer¡¯s template contains a ScrollContentPrensenter, two ScrollBars, and a Rectangle. They¡¯re hosted in a 2*2 Grid. The cube you see is exactly the Rectangle. You can delete this Rectangle in your own template, put some fancy elements in the 2 row, 2 column, or do whatever you like.

For your second question, no, you can¡¯t. Value is not a DependencyProperty. You can¡¯t use data binding on it¡­






Re: Windows Presentation Foundation (WPF) How to hide the 'cube' where the listboxes meet ?

Boman

Aaaah that whats going on Smile .. Maybe I should begin to use Blend more offen Smile.

Thank you for both answers .

/Bo