Ticket T189596
Visible to All Users

RichEditControl minimum margins

created 10 years ago

Please see the attached image.  On the left are TX Text Controls with margins set to 0.  On the right are DevExpress RichEditControls.  I can seem to get the margins set to 0.  I've tried

C#
richEditControl.Document.Sections[0].Margins.Left = 0; richEditControl.Document.Sections[0].Margins.Right = 0; richEditControl.Document.Sections[0].Margins.Top = 0; richEditControl.Document.Sections[0].Margins.Bottom = 0;

But that doesn't seem to do it.  How do I set the margins to 0?

Answers approved by DevExpress Support

created 10 years ago (modified 10 years ago)

Looks like the solution is
                richEditControl.Views.SimpleView.Padding = new System.Windows.Forms.Padding(0);

    Comments (3)
    DevExpress Support Team 10 years ago

      Hi Timothy,

      Thank you for informing us that you have resolved the issue by using the SimpleView.Padding property. Please do not hesitate to contact us in case of any difficulty. We will be happy to help you!

      Note that there are additional settings that affect the "spacing" depending on RichEditControl.ActiveViewType:
      PrintLayout - Section.Margins
      Simple - SimpleView.Padding
      Draft - DraftView.Padding

      You can find more detailed information in this regard here: How to adjust left padding of a document in RichEditControl.

        I had been using the solution by Timothy for years:

        richEditControl.Views.SimpleView.Padding = new System.Windows.Forms.Padding(0);

        Today, after updating to version 20.x, I receive "Value of type 'Padding' cannot be converted to 'PortablePadding'".

        What must be done to correct this?

          I found out. Instead use:

          New DevExpress.Portable.PortablePadding(0)

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.