We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

FindRange with search up option

Thread ID:

Created:

Updated:

Platform:

Replies:

60455 May 4,2007 05:44 PM May 10,2007 05:15 PM Windows Forms 2
loading
Tags: EditControl
Craig Timmerman
Asked On May 4, 2007 05:44 PM

I can't seem to make FindRange search up.

I am using FindRange with a regexp to first find a specific block of text:

// Search from the top to bottom looking for "NAME:func1"
CoordinatePoint stpt = this.Editor.ConvertVirtualPointToCoordinatePoint(1,1);
ITextRange range = this.Editor.FindRange("\bNAME\b.*\bfunc1\b", stpt, null, true, true, false, true);

I then want to start from the point found and search backwards (up) to find another string:


CoordinatePoint pt = this.Editor.ConvertVirtualPointToCoordinatePoint(range.Start.PhysicalPoint.Position, range.Start.PhysicalPoint.Line);
this.Editor.FindRange("\bBEGIN_DEFINITION\b", pt, stpt, true, true, true, true);

The range returned by the second call is always null. The following text is that is in the Edit Control


#BEGIN_DEFINITION
#NAME:func1
#TYPE:codeblock
#
# BEGIN_COMMENT
#
# END_COMMENT
#
#END_DEFINITION

Craig Timmerman
Replied On May 4, 2007 05:57 PM

I forgot to mention, this is Syncfusion 4.2.0.37

Administrator [Syncfusion]
Replied On May 10, 2007 05:15 PM

Hi Craig,

It is possible to search up using the FindRange method. I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thank you for your patience.

Regards,
Ebenezer.P

http://websamples.syncfusion.com/samples/Edit/60455/main.htm

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;