Dragging and Scrolling

J

Jonathan

I have a form that has controls on it that can be dragged to other
locations within the form. The form size is larger than the viewable
area so the scroll bars are visible (and autoscroll is enabled). When
I drag a control to the edge of the visible border, I am sending the
WM_HSCROLL/WM_VSCROLL message to the parent form to initiate a scroll.
This works good, the parent form scrolls and keeps scrolling until the
control is dropped or moved away from the edge of the visible form, but
my problem is that the control that is being dragged needs to appear as
though it is in the same place after the scroll. Moving the control
before or after sending the scroll message gives the appearance of the
dragging control "tearing" or flickering. It needs to appear as though
it isnt moving at all.

If I lockwindowsupdate during the scroll, the dragging control appears
to stay in one place, but the other controls on the form flicker when a
scroll is initiated.

Is there a way to lock a portion of a window? I have done some
research, but havent come up with anything. Does anyone have any
ideas?

TIA.
 
C

Cor Ligthert

Jonathan,

Probably will it change your approach, have a look at panels, docking and
maybe even splitter.

I hope this helps,

Cor
 
J

Jonathan

I understand you recommendation, but this just seems like something
that should be doable. One option could be to hide the control that is
being dragged when a scroll in initiated and just change the cursor to
an arrow in the direction of the scroll. While that could be done, it
just isnt something I am ready to do just yet. Anyone else have any
ideas? I know that Microsoft folks hang out in the newsgroups, do you
have any insight?
 

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