The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

SubDocument.GetCustomMarkByVisualInfo(CustomMarkVisualInfo) Method

Obsolete. Provides access to a custom mark in the RichEditControl.CustomMarkDraw event handler.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

[Obsolete("This method has become obsolete. Use the 'DevExpress.XtraRichEdit.API.Native.CustomMarkCollection.GetByVisualInfo(DevExpress.XtraRichEdit.Layout.Export.CustomMarkVisualInfo customMarkVisualInfo)' method instead.")]
CustomMark GetCustomMarkByVisualInfo(
    CustomMarkVisualInfo customMarkVisualInfo
)
<Obsolete("This method has become obsolete. Use the 'DevExpress.XtraRichEdit.API.Native.CustomMarkCollection.GetByVisualInfo(DevExpress.XtraRichEdit.Layout.Export.CustomMarkVisualInfo customMarkVisualInfo)' method instead.")>
Function GetCustomMarkByVisualInfo(
    customMarkVisualInfo As CustomMarkVisualInfo
) As CustomMark

Parameters

Name Type Description
customMarkVisualInfo DevExpress.XtraRichEdit.Layout.Export.CustomMarkVisualInfo

A DevExpress.XtraRichEdit.Layout.Export.CustomMarkVisualInfo class instance, containing information required to visualize a custom mark.

Returns

Type Description
CustomMark

A CustomMark associated with the specified visual info.

Remarks

This code snippet illustrates the use of the SubDocument.CreateCustomMark method and the RichEditControl.CustomMarkDraw event, to add a mark to the selection and draw its visual representation.

Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.XtraRichEdit.Layout.Export
Imports System.Drawing.Drawing2D
        Private Sub btn_Mark_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_Mark.Click
            Dim doc As Document = richEditControl1.Document
            Dim m As CustomMark = doc.CustomMarks.Create(doc.Selection.Start, Color.DarkOrange)
        End Sub

        Private Sub richEditControl1_CustomMarkDraw(ByVal sender As Object, ByVal e As DevExpress.XtraRichEdit.RichEditCustomMarkDrawEventArgs) Handles richEditControl1.CustomMarkDraw
            For Each info As CustomMarkVisualInfo In e.VisualInfoCollection
                Dim doc As Document = richEditControl1.Document
                Dim mark As CustomMark = doc.CustomMarks.GetByVisualInfo(info)
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias

                Dim curColor As Color = CType(info.UserData, Color)
                If mark.Position < doc.Selection.Start Then
                    curColor = Color.Green
                End If
                    Dim p As New Pen(curColor, 3)
                    p.StartCap = LineCap.Flat
                    p.EndCap = LineCap.ArrowAnchor
                    e.Graphics.DrawLine(p, New Point(0, info.Bounds.Y), info.Bounds.Location)
            Next info
        End Sub
See Also