Drag/resize an image on UserForm by the user

  • Thread starter Thread starter avi
  • Start date Start date
A

avi

Hello,

I'm looking for an example/approach for moving and resizing an image
displayed on a userForm, by the user (not in the design phase) by
directly interacting with the image, and not by providing parameters

Is it either doable?

Thanks a lot
Avi
 
You could conceivably do it with code by putting a button on the form which
has preset parameters to unload the current form and redraw it to the preset
parameters. I don't know of a way to drag the changes, but then I'm not the
smartest guy on the block either.
 
Had a look at this some weeks ago and I think it is doable but very fiddly.

Catch the start of the move or re-size in the mouse_down event.
From the position of the cursor at the mouse-down decide if it is a re-size
or a move you want to start.
Do the move/resize based on the mouse movements.
Catch the mouse_up event and that will stop your action.

I thought it was too fiddly and left it, but if anybody has some nice code
for this then
I would be interested.

RBS
 
Very nice and thanks for posting that!
Needed to add On Error Resume Next to AxeX and AxeY.
Would there be any problem using this with a Frame?

RBS
 
Would there be any problem using this with a Frame?

Yes, no trouble with that and as I only needed the drag I could leave some
code out.
Very nice bit of code.

RBS
 
Back
Top