• 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
    Remarks

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

    You can also set SetLineReadonly method to make some lines read-only rather than the entire content.

    Examples

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

    public partial class MainWindow : Window
    {
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var textEditor = new Alternet.Editor.Wpf.TextEditor();
            textEditor.LoadFile("myfile.txt");
            textEditor.ReadOnly = true;
        }
    }
    

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

    Partial Public Class MainWindow
    
        Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Dim textEditor = New Alternet.Editor.Wpf.TextEditor()
            textEditor.LoadFile("myfile.txt")
            textEditor.ReadOnly = True
        End Sub
    End Class
    
    In This Article
    Back to top Copyright AlterNET Software Download PDF