Placing controls correctly on panel.

O

objectref

Hi to all folks,


i have the following problem and i have spent many hours to solve it
but without any result, so, here it is:

Imagine that you have a mdi-child form that has a panel on it, a panel that
it's
height has the value of 3000. The panel also has a vertical scrollbar so i
can
move the panel up and down a little.

So, in the main MDI parent form, i have some images(picture boxes) that i
succesfully drag and
drop on the child form, that with the panel.

The drag and drop operation works really nice, i get the MousePosition
property,
compute the available screen width (parent - images pallete) and drop the
image
onto the panel.

The problem is that when i press down a little the panels' scrollbar and try
to
place the image on that position, it does not "undesrtand" the position
and the image is placed always much above the desired point.

So, if i scroll the panel down, i cannot place there images, thy are placed
on the
panel but always relative to the upper left corner of the screen.
(MousePosition)

Is there way to be able to do this ? So i can place images in every position
on panel
surface (that is, from 1 to 3000 of it's height) and just stay there ??


Thanks a lot for any help,

objectref
 
O

objectref

Where i refer to MousePosition, i refer to :
this.PointToClient(MousePosition)
 

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