Property Source
Source
Gets or sets an object that implements ITextSource
interface containing an actual string data displayed by the control.
public virtual ITextSource Source { get; set; }
Property Value
Examples
Here is how to set a Source different TextSource from the C# code:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
var syntaxEdit2 = new Alternet.Editor.SyntaxEdit(this.components);
var textSource = new Alternet.Editor.TextSource.TextSource(this.components);
textSource.LoadFile("myfile.txt");
syntaxEdit1.Source = this.textSource;
syntaxEdit2.Source = this.textSource;
}
}
Here is how to set a Source different TextSource from 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)
Dim syntaxEdit2 = New Alternet.Editor.SyntaxEdit(Me.components)
Dim textSource = New Alternet.Editor.TextSource.TextSource(Me.components)
textSource.LoadFile("myfile.txt")
syntaxEdit1.Source = Me.textSource
syntaxEdit2.Source = Me.textSource
End Sub
End Class
Remarks
Set this property to display text content from a different text source.
Source object can be assigned to several SyntaxEdit controls so that they can provide multiple views of the text.