Created
March 6, 2013 16:05
-
-
Save facebookegypt/5100389 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Timg_Click() | |
'Load pictures in Image control using CommonDialog method. | |
Cdl.Filter = ("Jpeg Jpg Photo Type (*.Jpg) |*.Jpg") | |
Cdl.CancelError = False | |
Cdl.DialogTitle = ("Choose a friend photo") | |
Cdl.ShowOpen | |
If Cdl.FileName = Trim("") Then | |
PicNm = App.Path & "/Phone1.Jpg" | |
Else | |
PicNm = ("") | |
PicNm = Cdl.FileName | |
End If | |
Timg.Picture = LoadPicture(PicNm) | |
End Sub | |
Private Sub Timg_OLEDragDrop(Data As DataObject, Effect As Long, _ | |
Button As Integer, Shift As Integer, X As Single, _ | |
Y As Single) | |
'Loading pictures into Image control using Drag&Drop method. | |
On Error GoTo ErrH1 | |
Dim vFile As Variant | |
If Data.GetFormat(vbCFFiles) = True Then | |
For Each vFile In Data.Files | |
PicNm = vFile | |
Timg.Picture = LoadPicture(vFile) | |
Next vFile | |
End If | |
Exit Sub | |
ErrH1: | |
vFile = Trim("") | |
PicNm = Trim("") | |
MsgBox "Please choose " & vbCrLf & "Jpg, Ico, Gif or BitMap" & vbCrLf & _ | |
"Picture format", , "Wrong" | |
Resume Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment