problem in mouse event if control width is more than 32767

G

Guest

hi all i am having a problem mouse move event .
i created a control with width 40,0000 .now in mouse move event handler e.x
returns value upto 32767 units ,beyond it returns negative values , what to
do .actually i am using panel control , as i have to do a lot of drawing on it . say i have to draw rectangles . then i want to move these rectangles , now when i try to move these rectangle in mousemove event by changing the coordinates of rectangles as given by e.X all works fine upto 32767 but afetr tht e.X returns neagtive values , n moving of rectangles halts ,how to handle tht ..
 
N

Nicholas Paldino [.NET/C# MVP]

Amit,

This is just a guess, but maybe casting the result to an unsigned Int16
(ushort) might give you the correct number.

Hope this helps.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi amit,

I'm really curious, how do you make a control with size 40,000? The size is
limited to 32767 and this limitation comes, as far as I know, from the
Windows OS itself.

Can you post some sample that creates such a huge control?. Then we might
workout something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top