• HOME
  • PRODUCTS
  • DEMOS
  • BUY
  • BLOG
  • FORUM
  • DOCUMENTATION
  • ABOUT
  • FREE EVALUATION
Search Results for

    Show / Hide Table of Contents

    ReadOnly Property

    ReadOnly

    Gets or sets a value indicating whether the control's content is read-only.

    Declaration
    public virtual bool ReadOnly { get; set; }
    Property Value
    Type Description
    Boolean
    Implements
    IEdit.ReadOnly
    Remarks

    Setting the ReadOnly property to true will restrict any changes to SyntaxEdit control content.

    Set the SetLineReadonly method to make specific lines read-only rather than the entire content.

    Examples

    Here is how to use a ReadOnly in the C# code:

    public partial class Form1 : Form
    {
        private void Form1_Load(object sender, EventArgs e)
        {
            var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
            syntaxEdit1.LoadFile("myfile.txt");
            syntaxEdit1.ReadOnly = true;
        }
    }
    

    Here is how to use a ReadOnly in the Visual Basic code:

    Partial Public Class Form1
        Inherits Form
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
            Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
            syntaxEdit1.LoadFile("myfile.txt")
            syntaxEdit1.ReadOnly = True
        End Sub
    End Class
    
    In This Article
    Back to top Copyright AlterNET Software Download PDF