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.
Syncfusion Feedback

convert points to current col/row

Thread ID:

Created:

Updated:

Platform:

Replies:

54578 Jan 11,2007 05:54 PM UTC Jan 12,2007 07:42 PM UTC Windows Forms 3
loading
Tags: EditControl
David Union
Asked On January 11, 2007 05:54 PM UTC

I'd like to select a block of text and insert text before and after. I see API's to convert current col to top/bottom coordinates. The select returns coordinates. How do I convert them to row/column for the sake of inserting?

Thanks.

Administrator [Syncfusion]
Replied On January 12, 2007 05:13 PM UTC

Hi David,

Our apologies for the delayed response. It is possible to convert CoordinatePoint to row and column. I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample

David Union
Replied On January 12, 2007 07:28 PM UTC

Thanks for the help so far, this got me about 60%. On a context menu handler I did:

int startLine=this.editControl1.Selection.Start.VirtualLine;
int startColumn=this.editControl1.Selection.Start.VirtualColumn;
int endLine=this.editControl1.Selection.End.VirtualLine;
int endColumn=this.editControl1.Selection.End.VirtualColumn;
this.editControl1.InsertText(endLine,endColumn,"\n#endregion\n");
this.editControl1.InsertText(startLine,startColumn,"\n#region\n");


I'm trying to add these (comment) tags around the block of selected text. This works if the user is careful to select whole rows. But if they select part of a row, for example the middle of a row, it puts the stuff before the row. If they go from the beginning of one row the the end of the next, but not to the beginning of the next line, that is 'still on the prior line', it causes the syncfusion parse engine to crash.

Do you want an update of my xml config file to see if there is some connection?

My reason for trying to do the 'end' first was the assumption that once I insert, the lines move down, and the old 'end' block will have changed, but the offset to the 'start' block should not have.

>Hi David,

Our apologies for the delayed response. It is possible to convert CoordinatePoint to row and column. I have attached a sample that illustrates this. Let me know if this meets your requirements.

David Union
Replied On January 12, 2007 07:42 PM UTC

Actually thanks, I've got it all working OK
now. This was exactly what I was looking for.

David Union


>Hi David,

Our apologies for the delayed response. It is possible to convert CoordinatePoint to row and column. I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample

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.

Warning Icon 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.Close Icon

;