home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmOLEDrag2
- Caption = "OLEDrag2"
- ClientHeight = 4305
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 5625
- LinkTopic = "Form1"
- ScaleHeight = 4305
- ScaleWidth = 5625
- StartUpPosition = 3 'Windows Default
- Begin VB.PictureBox picDragTo
- AutoSize = -1 'True
- Height = 1770
- Index = 2
- Left = 3600
- OLEDropMode = 1 'Manual
- ScaleHeight = 1710
- ScaleWidth = 1650
- TabIndex = 6
- Top = 2520
- Width = 1710
- End
- Begin VB.PictureBox picDragTo
- AutoSize = -1 'True
- Height = 1770
- Index = 1
- Left = 1800
- OLEDropMode = 1 'Manual
- ScaleHeight = 1710
- ScaleWidth = 1650
- TabIndex = 5
- Top = 2520
- Width = 1710
- End
- Begin VB.PictureBox picDragTo
- AutoSize = -1 'True
- Height = 1770
- Index = 0
- Left = 0
- OLEDropMode = 1 'Manual
- ScaleHeight = 1710
- ScaleWidth = 1650
- TabIndex = 4
- Top = 2520
- Width = 1710
- End
- Begin VB.PictureBox picDragFrom
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- Height = 1770
- Index = 3
- Left = 1800
- OLEDragMode = 1 'Automatic
- Picture = "OLEDrag2.frx":0000
- ScaleHeight = 1710
- ScaleWidth = 1395
- TabIndex = 3
- Top = 270
- Width = 1455
- End
- Begin VB.PictureBox picDragFrom
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- Height = 1290
- Index = 2
- Left = 4680
- OLEDragMode = 1 'Automatic
- Picture = "OLEDrag2.frx":7CF2
- ScaleHeight = 1230
- ScaleWidth = 870
- TabIndex = 2
- Top = 510
- Width = 930
- End
- Begin VB.PictureBox picDragFrom
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- Height = 1110
- Index = 1
- Left = 3360
- OLEDragMode = 1 'Automatic
- Picture = "OLEDrag2.frx":B594
- ScaleHeight = 1050
- ScaleWidth = 1155
- TabIndex = 1
- Top = 600
- Width = 1215
- End
- Begin VB.PictureBox picDragFrom
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- Height = 1590
- Index = 0
- Left = 0
- OLEDragMode = 1 'Automatic
- Picture = "OLEDrag2.frx":CFB6
- ScaleHeight = 1530
- ScaleWidth = 1650
- TabIndex = 0
- Top = 360
- Width = 1710
- End
- Begin VB.Label Label1
- Caption = "Drag to:"
- Height = 255
- Index = 1
- Left = 0
- TabIndex = 8
- Top = 2160
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Drag from:"
- Height = 255
- Index = 0
- Left = 0
- TabIndex = 7
- Top = 0
- Width = 1215
- End
- Attribute VB_Name = "frmOLEDrag2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Get the dropped picture if the source is a bitmap
- ' or a graphic file.
- Private Sub picDragTo_OLEDragDrop(Index As Integer, Data As DataObject, _
- Effect As Long, Button As Integer, Shift As Integer, _
- X As Single, Y As Single)
- Dim ext As String
- ' See if we know what to do with the data.
- If Data.GetFormat(vbCFBitmap) Then
- ' Copy the bitmap.
- picDragTo(Index).Picture = Data.GetData(vbCFBitmap)
- Effect = vbDropEffectCopy
- ElseIf Data.GetFormat(vbCFFiles) Then
- ' See if this is a file name ending in
- ' bmp, gif, jpg, or jpeg.
- ext = LCase$(Right$(Data.Files(1), 4))
- If (ext = ".bmp") Or _
- (ext = ".gif") Or _
- (ext = ".jpg") Or _
- (ext = "jpeg") _
- Then
- ' Load the file.
- picDragTo(Index).Picture = LoadPicture(Data.Files(1))
- Effect = vbDropEffectCopy
- Else
- ' Tell the source we did nothing.
- Effect = vbDropEffectNone
- End If
- Else
- ' Tell the source we did nothing.
- Effect = vbDropEffectNone
- End If
- End Sub
-