Autoscroll bug with a panel?

E

Ender

I have a Windows forms that I am trying to create a poor man's Visio
like environment. Users can drag items from a toolbox onto a panel
(which is part of my main form). In this case, the items that are
being dragged are essentially overloaded Label controls.

To make things Visio like I have also created a line control. The
line control works fine until I start scrolling. Initially I wasn't
taking into account the AutoScroll position on the panel when position
the control. So I changed things around to take this into account and
I was able to move control and have my line control be positioned
properly.

The problem I am running into now, is that for some reason, which I
have not been able to figure out, the AutoScroll postion is being
reset to (0,0). This happens at unexepcted times. For example, on
the MouseLeave event of the overloaded label, it resets the autoscroll
position. If I click on my line, the autoscroll position gets reset.

Am I not handling something properly in my line control's paint event?
The reason I ask is I would actually dynamically use the GDI+
DrawLine function and redraw all the lines each time, looping through
a collection of points. This however, raised soem serious performance
issues as the number of lines grew. When I used this method though, I
didn't see any issues with the AutoScroll position being rest.

This is really beating me down! If anyone has any ideas I would
greatly appreciate it.

Endymion
 

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