VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Useful for opening and closing pictures from files in a common dialog control.

by Brandon (46 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 5th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Useful for opening and closing pictures from files in a common dialog control.

Rate Useful for opening and closing pictures from files in a common dialog control.



'control from Project, Components, select Microsoft Common Dialog
'Controls 6.0, apply this setting and put the control on a form.
'make sure to change control names to the ones I've used below.

Private Sub cmdClosePic_Click()
'close current picture
Picture1.Picture = LoadPicture("")
cmdClosePic.Enabled = False
End Sub

Private Sub cmdOpenPic_Click()
'show common dialog box
CommonDialog1.ShowOpen
'load picture
Picture1.Picture = LoadPicture(CommonDialog1.FileName,4)
cmdClosePic.Enabled = True
End Sub

Private Sub Form_Load()
'disenable control
cmdClosePic.Enabled = False
End Sub




Download this snippet    Add to My Saved Code

Useful for opening and closing pictures from files in a common dialog control. Comments

No comments have been posted about Useful for opening and closing pictures from files in a common dialog control.. Why not be the first to post a comment about Useful for opening and closing pictures from files in a common dialog control..

Post your comment

Subject:
Message:
0/1000 characters