This is a migrated thread and some comments may be shown as answers.

Copy richtextbox PageOrientation and PageMargin

2 Answers 106 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
aubrey
Top achievements
Rank 1
aubrey asked on 24 Jun 2011, 10:40 AM
Good Day Telerik Team,

Is there a way i can copy the page Orientation and Margin of a richtextbox so that i can apply it to other richtextbox? :'(

 heres my code:
RadDocument doc = new RadDocument();
 
this.radRichTextBox1.Document.Selection.SelectAll();
 
doc = this.radRichTextBox1.Document.Selection.CreateDocumentFromSelection();
this.radRichTextBox1.Document.Selection.Clear();
doc.CaretPosition.MoveToFirstPositionInDocument();
 
prev.rtbPrev.Document = doc;
prev.rtbPrev.ChangeLayoutMode(radRichTextBox1.Document.LayoutMode);
prev.rtbPrev.Document.CopyPropertiesFrom(radRichTextBox1.Document);
I was able to copy and apply the layout mode and page Size of a RichTextBox to other RichTextBox. but i was not able to get the page orientation and margin. :(

Thanks,
Aubrey :'(

2 Answers, 1 is accepted

Sort by
0
Accepted
Boby
Telerik team
answered on 29 Jun 2011, 04:59 PM
Hi aubrey,
PageOrientation and PageMargin are properties of the Section class. As of now, document contains only one section, so you can get the values from the first section in the first RadRichTextBox' document and set them to to the first section of the second one.

Best wishes,
Boby
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
aubrey
Top achievements
Rank 1
answered on 30 Jun 2011, 01:59 AM
Hi Boby,

Thanks a lot, i got it now. :')

Regards,
aubrey :')
Tags
RichTextBox
Asked by
aubrey
Top achievements
Rank 1
Answers by
Boby
Telerik team
aubrey
Top achievements
Rank 1
Share this question
or