Articles in this section
Category / Section

How to show or hide the scrollbar on mouse over and mouse leave in a WPF EditControl?

2 mins read

To show scrollbar on mouse over, set the VerticalScrollBarVisibility and the “HorizontalScrollBarVisibility properties to Auto mode when the IsMouseOver property is True”, otherwise, set them to Hidden.


[XAML]

<Grid>
        <Grid.Resources>
                <Style TargetType="syncfusion:EditControl">
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
                            <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver"
                                 Value="False">
                            <Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
                            <Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>         
        </Grid.Resources>
        <syncfusion:EditControl HorizontalContentAlignment="Left" Text="{Binding Text}"  DocumentLanguage="SQL"/>
</Grid>

 

The following screenshots illustrates the output of the above code example

On mouse over:

On mouse leave:

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please  to leave a comment
Access denied
Access denied