Skip to content

Customizing the scroll bar of the TextEditor control #416

Closed Answered by mgarstenauer
kokaKOLA-NEW asked this question in Q&A
Discussion options

You must be logged in to vote

Here is an example: I added a style to AvaloniaEdit.Demo to make the vertical scrollbar background red:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:AvalonEdit="using:AvaloniaEdit"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="AvaloniaEdit.Demo.MainWindow" ...>

  <Window.Styles>
    <Style Selector="AvalonEdit|TextEditor.red /template/ ScrollViewer /template/ ScrollBar#PART_VerticalScrollBar">
      <Setter Property="Background" Value="Red"/>
    </Style>
  </Window.Styles>

    ...

        <AvalonEdit:TextEditor Classes="red"
                               HorizontalScrollBarVisibility="Auto"
                               VerticalScroll…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kokaKOLA-NEW
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kokaKOLA-NEW
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants