
Hi guys,
From another thread on this forum, I was made to believe that I could jump to a specific line using the FirstVisiblePosition. In this specific case, I need to make a certain line the first/top visible line in the control, so the property does sound like exactly what I'm looking for :). However, it doesn't seem to be working like it should, so I created a small demo to re-produce the problem. Here is the gist of it - everything else is just a standard WPF app with a SyntaxEditor control on the Window:When I run the code, the control seems to just scroll a single line down, so that the second line is in top. Line 50 is nowhere near. Am I missing something or is there a bug? :)
[Modified at 09/06/2011 04:41 AM]
From another thread on this forum, I was made to believe that I could jump to a specific line using the FirstVisiblePosition. In this specific case, I need to make a certain line the first/top visible line in the control, so the property does sound like exactly what I'm looking for :). However, it doesn't seem to be working like it should, so I created a small demo to re-produce the problem. Here is the gist of it - everything else is just a standard WPF app with a SyntaxEditor control on the Window:
public MainWindow()
{
InitializeComponent();
syntaxEditor1.IsLineNumberMarginVisible = true;
StringBuilder sb = new StringBuilder();
for(int i = 1; i < 100; i++)
sb.Append("Line " +i + Environment.NewLine);
syntaxEditor1.Document.SetText(sb.ToString());
syntaxEditor1.ActiveView.FirstVisiblePosition = new ActiproSoftware.Text.TextPosition(50, 0);
}
[Modified at 09/06/2011 04:41 AM]