Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog Control

Status
Not open for further replies.

NikolaSlinger

Programmer
Joined
May 25, 2002
Messages
1
Location
US
Ok, I know this sounds pathetic, but I have forgotten how to use my Common Dialog Box and I need someone to send some sample code!!! Any way you can help...
 
Here is a sample that I snarfed from one of my picture programs. Slightly compressed on this small note pad but perhaps it will help.
RSH


Public Sub AllPictures() 'This opens a file via Common dialog box
On Error GoTo Cancel 'Set(Cancel Error) to true in properties window
CommonDialog1.DialogTitle = "CHOOSE A FILE TO OPEN" 'Title for Dialog Box
CommonDialog1.InitDir = Route 'More page 357 Black Book"
CommonDialog1.Filter = "IMAGE FILES(*.jpg, *.bmp)|*.jpg;*.bmp|ALL FILES (*.*)|*.*"
CommonDialog1.ShowOpen 'Show Dialog box for open
Image1.Picture = LoadPicture(CommonDialog1.FileName)
Call ButtonsOff
GoTo PassCancel
Cancel: Call ButtonsOn
PassCancel:
Route = CommonDialog1.FileName 'This brings common dialog back to originally selected page unless changed
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top