Exemplo n.º 1
0
    /// <summary>
    /// This method switches the mode of the underlying RichTextBox
    /// that is used for rendering according to the
    /// <see cref="ShapeDrawAction"/> of this element.
    /// When no fill ist set, the RichTextBox is transparent and
    /// only in this case use the CreateParams.Transparent styled
    /// RichTextBox, because this one renders crispy for
    /// unknown reason.
    /// </summary>
    private void RebuildUnderlyingRichTextBox()
    {
      string rtfBackup = this.richTextBox != null ? this.richTextBox.Rtf : string.Empty;

      if (this.richTextBox != null)
      {
        this.richTextBox.Dispose();
      }

      if ((this.ShapeDrawAction & ShapeDrawAction.Fill) == ShapeDrawAction.Fill)
      {
        this.richTextBox = new RichEdit50Opaque();
      }
      else
      {
        this.richTextBox = new RichEdit50Transparent();
      }

      this.richTextBox.Rtf = rtfBackup;
      this.textLength = this.richTextBox.TextLength;
      this.handleToRichTextBox = this.richTextBox.Handle;
    }
Exemplo n.º 2
0
 /// <summary>
 /// Prevents a default instance of the VGRichText class from being created.
 /// Parameterless constructor. Used for serialization.
 /// </summary>
 private VGRichText()
 {
   this.richTextBox = new RichEdit50Opaque();
   this.textLength = this.richTextBox.TextLength;
   this.handleToRichTextBox = this.richTextBox.Handle;
 }