1

So I have the following XAML:

<DockPanel Name="dpSchedItem" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" LastChildFill="True">
    <Image DockPanel.Dock="Right" Height="17" Width="17" VerticalAlignment="Top" HorizontalAlignment="Right" Cursor="Hand" Margin="0,0,0,0" Source="Resources\Pencil_Gray.png" MouseUp="Image_MouseUp" />
    <RichTextBox DockPanel.Dock="Left" Name="rtbText" Margin="0,0,0,0" VerticalScrollBarVisibility="Auto" BorderThickness="0" BorderBrush="Transparent" IsReadOnly="True" />
</DockPanel>

And I add content to the RichTextBox in code:

rtbText.BorderBrush = BackgroundColor
Dim p As New Paragraph
p.Inlines.Add(New Bold(New Run(SO & If(Title = "", "", " - " & Title))))
rtbText.Document = New FlowDocument(p) With {.Background = BackgroundColor, .PagePadding = New Thickness(0.0)}

But it's rendered like this:

Rendered

I tried overriding the control template like it shows here for a button, but the RTB doesn't have the same content property. From another post I got the idea to set the PagePadding thickness to 0 for the FlowDocument, but that didn't get the results I wanted.

I want that space (border or margin, or whatever it is) to be green like everything else.

Community
  • 1
  • 1
tolsen64
  • 881
  • 1
  • 9
  • 22

1 Answers1

1

It is unclear if the holding grid/page is green but make the controls background color Transparent until a full green is achieved such as:

<DockPanel Background="Transparent"...>
   <RichTextBox Background="Transparent" BorderBrush="Transparent" ...>

Or make the DockPanel's background Green and the RichTextBox Background Transparent.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • >Or make the DockPanel's background Green and the RichTextBox Background Transparent - This worked. Facepalm for not seeing that myself. Thanks! – tolsen64 Jul 11 '16 at 16:22
  • @tolsen64 We have all been there, its always the *little* things. Glad to help. – ΩmegaMan Jul 11 '16 at 16:43