Winui 3 ScrollBar problem ... control wont show

cpehonk 21 Reputation points
2022-03-29T19:37:59.327+00:00

Hi all, I have a serious problem with ScrollBar control using Winui 3. Regardless what I am trying, no scrollbar shows up. Here is my little test window:

 <Window
        x:Class="ControlTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:ControlTest"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d">
        <Grid>
            <Border x:Name="_Main" Background="{ThemeResource SystemColorBackgroundBrush}"/>
            <ScrollBar x:Name="_hScroll" Orientation="Horizontal" VerticalAlignment="Bottom" Maximum="500" ViewportSize="30" Visibility="Visible" IsHitTestVisible="True"/>
        </Grid>
    </Window>

My expectation: to get a horizontal scrollbar appearing at the bottom. The drag thumb should be 1/10 of the window width... But: NOTHING !
What did I miss ? Where is my mistake? Any help really appreciated!
Greetings,
Chris

Windows development | Windows App SDK
0 comments No comments
{count} votes

Answer accepted by question author
  1. Castorix31 91,506 Reputation points
    2022-03-29T20:19:46.447+00:00

    It appears if I add :

    IndicatorMode
    Width
    Height

    188047-scrollbar.jpg

                 <ScrollBar x:Name="_hScroll" IndicatorMode ="MouseIndicator"  Width="300" Height="40" Orientation="Horizontal" VerticalAlignment="Bottom" Maximum="500" ViewportSize="30" Visibility="Visible" IsHitTestVisible="True"/>  
        
    
    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.