Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get size of cursor in C#

Tags:

c#

winforms

I need to get the size of rectangle of classical windows cursor.

How can I get the size of the cursor in c#?

like image 416
ibrahimyilmaz Avatar asked Jun 18 '12 11:06

ibrahimyilmaz


People also ask

Why is pointer size 4 bytes in C?

Size of a pointer is fixed for a compiler. All pointer types take same number of bytes for a compiler. That is why we get 4 for both ptri and ptrc.

Why size of pointer is 8 bytes?

The pointer is 8 bytes, because you are compiling for a 64bit system. The int it is pointing at is 4 bytes.

What is the size of float pointer in C?

Source Code: C Program To Find Size of Pointer Variables Size of float pointer = 4 bytes. Size of double pointer = 4 bytes.


1 Answers

You can use Cursor.Size:

int cursorWidth = Cursor.Size.Width;
int cursorHeight = Cursor.Size.Height;

Yes, it is really that simple!

Hope this helps!

like image 94
matthewr Avatar answered Sep 18 '22 15:09

matthewr