The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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