Unable to ensure visibility of code in an EditorView

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Ulrich Proeller
Avatar
Hello,

I am opening programatically a second view in my editor by setting
editor.HorizontalSplitPosition = 200;
After that, I want to make sure, that a certain code portion is shown in my newly created view with the following code:

EditorView view = editor.Views[1];
view.EnsureVisible(350, true);
but nothing happens. The newly created view still shows the beginning of my code.
What am I doing wrong?

2. Question: How can I know, which view is which?. In the moment it seems to me that the newly created view (shown as upper view) is view[1], the lower view is view[0].

Thanks in advance

Uli

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
1) I added this code to the sample app:
editor.HorizontalSplitPosition = 200;
EditorView view = editor.Views[1];
view.EnsureVisible(350, true);
view.Selection.SelectRange(350, 351);
When I run the sample app and execute that immediately, it splits the view, and moves the caret in the upper view (see index 1 below). I can see where the caret is via the selection statement. So it looks like it works fine.

2) When there are multiple views, the original "base" view is always the first view in the collection, which is considered the lower right view.

If there are 4 views, these are the indices:
LowerRight = 0
UpperRight = 1
LowerLeft = 2
UpperLeft = 3


Actipro Software Support

The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.