Couting and Removing Markers

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Radjesh Klauke - X-impress
Avatar
Small question:

I'm marking the searchresults, but how do I remove them?
This is how I mark them:
Dim _findnext As FindReplaceOptions = New FindReplaceOptions
_findnext.FindText = txt_search.Text

.SelectedView.FindReplace.MarkAll(_findnext)
How do I count them and remove them?
Thanks in advance.

[Modified at 12/14/2011 08:25 AM]

Comments (6)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Radjesh,

The MarkAll() method returns a FindReplaceResultSet that tells you how many and where the marks were added.

For marks, a Document.SpanIndicatorLayers layer is added with key SpanIndicatorLayer.FindResultKey. You can look at that to clear them or remove individual ones. The Document.FindReplace.ClearSpanIndicatorMarks() method can also be used to clear them.


Actipro Software Support

Posted 12 years ago by Radjesh Klauke - X-impress
Avatar
Hi,

I already tried to use The Document.FindReplace.ClearSpanIndicatorMarks(), but nothing happens. The markers are still there.
Also tried to count them:

For Each xsyn As SyntaxEditor In document_tab.SelectedTab.AttachedControl.Controls
   With xsyn
      MsgBox(.Document.SpanIndicatorLayers.Count.ToString)  ' result = 0, but 2 are marked
   End With
Next
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Radjesh,

We may need to debug what you are doing to see if there is a problem on our end. Please make a new simple sample project that shows the issue and send it to our support address so that we can debug it. In the email, indicate the steps to repro the problem with your project. Please rename the .zip file extension so it doesn't get spam blocked. Thanks!


Actipro Software Support

Posted 12 years ago by Radjesh Klauke - X-impress
Avatar
Thanks. I created a ticket and included my test-editor. Hope you see what I'm doing wrong.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry the overload of MarkAll you use will create bookmark indicators, which are line indicators and not span indicators. Thus that method I suggested won't work unless you are marking with span indicators (another overload lets you do that).

To remove the bookmarks, you can do this:
SyntaxEditor1.Document.LineIndicators.Clear()


Actipro Software Support

Posted 12 years ago by Radjesh Klauke - X-impress
Avatar
Thanks for clearing things up.
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.