Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleLet the user resize an image with the mouse
Keywordsresize, image, mouse
CategoriesControls, Graphics
 
Set an Image control's Stretch property to True. Use the control's MouseDown, MouseMove, and MouseUp event handlers to let the user drag the corner of the control.
 
Private m_Dragging As Boolean

Private Sub Form_Load()
    Image1.Stretch = True
End Sub

Private Sub Image1_MouseDown(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    m_Dragging = True
End Sub

Private Sub Image1_MouseMove(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    If Not m_Dragging Then Exit Sub

    Image1.Move 0, 0, X, Y
End Sub

Private Sub Image1_MouseUp(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    m_Dragging = False
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated