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

SelectedText

Thread ID:

Created:

Updated:

Platform:

Replies:

14297 May 24,2004 07:39 PM UTC May 25,2004 04:57 PM UTC Windows Forms 2
loading
Tags: EditControl
Nick Howard
Asked On May 24, 2004 07:39 PM UTC

Hello, I have an edit control that I check to see if there is selected text. If I actually select text it works fine, but I have a problem when I don''t select any text. My text has some carriage returns and new lines. If I have three lines that each have a carriage return at the end I always get the line where the cursor is as the selected text. This happens even though I have no text selected. For example: Line 1\r\n Line 2\r\n Line 3\r\n If my cursor is in line 1 with nothing selected the SelectedText is Line 1\r\n. Is there something I''m doing wrong? Thanks, Nick

Administrator [Syncfusion]
Replied On May 25, 2004 04:14 PM UTC

Hi Nick This seems to be due to the CopyWithoutSelection property in Essential Edit (similar to VS.NET). This behavior should go away when you set this property to false but it does not. You could work around this by checking the HasSelection property: if(this.editControl1.HasSelection) { MessageBox.Show(this.editControl1.SelectedText); } I am uploading a sample. Kindly take a look and get back to us if you have any further questions. Regards Arun

Nick Howard
Replied On May 25, 2004 04:57 PM UTC

Thanks Arun. It works great now. I appreciate your help. >Hi Nick > >This seems to be due to the CopyWithoutSelection property in Essential Edit (similar to VS.NET). This behavior should go away when you set this property to false but it does not. > >You could work around this by checking the HasSelection property: >if(this.editControl1.HasSelection) >{ > MessageBox.Show(this.editControl1.SelectedText); >} > >I am uploading a sample. Kindly take a look and get back to us if you have any further questions. > >Regards >Arun >

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

;