The InsertCodeBlock method used is a correct way to add a code block in RadRichTextBox.
If the visualized code is not formatted in the desired way, could you elaborate on how do you wish that it is displayed? Also, what CodeFormattingSettings are you using when calling the InsertCodeBlock method?
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
I would like to remove the black border and expand it 100% height and width
0
Polya
Telerik team
answered on 31 Oct 2017, 12:11 PM
Hi Stefania,
The code block annotation is internally placed inside a table, which has the black table border. So in order to remove this border, we should get the parent table of our code block and set its Borders to empty borders:
// find the annotation start of the first code block.
Code blocks stretch by default to 100% of the width of the section they are placed in. If you are working in Paged layout mode and you wish to change the of the sections you could use the ChangeSectionActualPageMargin method:
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.