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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HOW TO: Get the caret position in the Rich Text control.

Thread ID:

Created:

Updated:

Platform:

Replies:

399 Jun 21,2002 06:20 AM UTC Jun 21,2002 06:25 PM UTC WinForms 1
loading
Tags: FAQ
Abhi
Asked On June 21, 2002 06:20 AM UTC

Hi, I want to get the caret position in Rich Edit control. Is there any method in C# which i can use? I tried to use the GetCaretPos API but unbale to use it. [System.Runtime.InteropServices.DllImport("user32.dll")] static extern bool GetCaretPos(Intptr point); Point curPos; GetCaretPos( curPos ); This gives me compilation error as type mismach. How sould i use this API. Thanks, AN

Administrator [Syncfusion]
Replied On June 21, 2002 06:25 PM UTC

Hi, First declare this struct: public struct POINT { public int X; public int Y; public POINT(int x, int y) { this.X = x; this.Y = y; } } and then try chaning the declaration as: static extern bool GetCaretPos(ref POINT point); and then use the method as: POINT pt = new POINT(0, 0); GetCaretPos(ref pt); I think this should work. Regards, -Praveen Ramesh Syncfusion, Inc. > Hi, > > I want to get the caret position in Rich Edit control. Is there any method in C# which i can use? > I tried to use the GetCaretPos API but unbale to use it. > > [System.Runtime.InteropServices.DllImport("user32.dll")] > static extern bool GetCaretPos(Intptr point); > > Point curPos; > GetCaretPos( curPos ); > This gives me compilation error as type mismach. > > How sould i use this API. > > Thanks, > AN

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

;