Resize Control 
Author Message
 Resize Control

I want to allow the user to resize a picturebox control at runtime by
dragging a resize handle at the lower right. Is this possible?

Can someone please point me in the right direction on this issue?

Thanks.

Eric



Wed, 19 Jan 2005 05:31:17 GMT  
 Resize Control
Use the mouse down and mouse up events on the handle, using a boolean value
you can know when the user is holding down the handle, and when he lets
go... You can then use mouse coordinates (e.X, e.Y in events) to resize the
picture from its current position.

    -Chris



Quote:
> I want to allow the user to resize a picturebox control at runtime by
> dragging a resize handle at the lower right. Is this possible?

> Can someone please point me in the right direction on this issue?

> Thanks.

> Eric



Wed, 19 Jan 2005 05:52:15 GMT  
 Resize Control
Chris,

You lost me on one part of your response. How do I use the mouse down and
mouse up events on the handle, when the handle does not appear to be
available for a picturebox control? When a picturebox control (and all other
controls, as far as I know) are placed on a form, the only options for the
border are None, Fixed Single, and Fixed 3D. Resizeable only appears to be
an option when using a form. Am I missing something here?

Eric


Quote:
> Use the mouse down and mouse up events on the handle, using a boolean
value
> you can know when the user is holding down the handle, and when he lets
> go... You can then use mouse coordinates (e.X, e.Y in events) to resize
the
> picture from its current position.

>     -Chris



Wed, 19 Jan 2005 07:15:46 GMT  
 Resize Control
Eric,
What Chris left out was you will need to draw the handle yourself. Then use
the mouse events to resize the picture box...

Consider using the Paint event to draw the handle. Remember you will need to
draw the handle on the form, not the picture box.

Hope this helps
Jay



Quote:
> Chris,

> You lost me on one part of your response. How do I use the mouse down and
> mouse up events on the handle, when the handle does not appear to be
> available for a picturebox control? When a picturebox control (and all
other
> controls, as far as I know) are placed on a form, the only options for the
> border are None, Fixed Single, and Fixed 3D. Resizeable only appears to be
> an option when using a form. Am I missing something here?

> Eric



> > Use the mouse down and mouse up events on the handle, using a boolean
> value
> > you can know when the user is holding down the handle, and when he lets
> > go... You can then use mouse coordinates (e.X, e.Y in events) to resize
> the
> > picture from its current position.

> >     -Chris



Wed, 19 Jan 2005 09:15:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Resize form - resize controls

2. Correction: Resize form - resize controls

3. VB5 Resizing and Paint do not resize control

4. Dynamically move/resize controls on resized form

5. Resizing controls on SSTab causes some controls to always appear on top

6. Control to resize controls on a form

7. Auto Resize Controls With Form

8. autosize / resize control

9. Resize Controls Runtime

10. Resizing controls...

11. Resizing controls automatically...

12. Resizing controls on forms automatically to suit screen resolutions

 

 
Powered by phpBB® Forum Software