Selection problem with RichTextBox

Selection problem with RichTextBox

Post by Jacob Ya » Thu, 15 Aug 2002 12:37:18



Hi Greg,

I don't think this is currently possible.  The only way I can think of to
do this is to do the following:

[DllImport("user32", CharSet=CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam,
int lParam);
private static const int EM_SETSEL = 0x00B1;

// ?-
int start = 4;
int end = 2;

// Select starting from character at index for, backwards to character 2.
SendMessage(richTextBox1.Handle, EM_SETSEL, start, end);

I will report this issue to the development team.

Thanks,

Jacob Yang
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved

 
 
 

Selection problem with RichTextBox

Post by Greg Los » Thu, 15 Aug 2002 13:21:06


Ok thx - I actually used that same solution today to get it working. It
will be nice once they get the whole Win32 API ported into .net but for
now INterop provides a way manage.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
 
 

1. Selection problem with RichTextBox

Hi Greg,

I have reproduced the problem on my side and totally understood your
meaning. I am researching this issue now. I will contact you as soon as
possible.

Thanks,

Jacob Yang
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved

2. Adaptec SCSI drivers trashing disks..., fixed?

3. How to Change Cursor In Selection Margin of RichTextBox?

4. A different \sqrt

5. selection in RichTextBox -- UGHHH!

6. Help for function mdlDialog_itemSetValue()

7. Invisible selection i RichTextBox

8. MS Exchange Meailbox problem! No response last time I asked!

9. RichTextBox Problem #2 (some mistake)

10. RichTextBox problem with IME.

11. RichTextBox problems...

12. RichTextBox.ScrollToCaret problem

13. RichTextBox, DragDrop Problem