Home
Username:
Password:
Microsoft Visual Basic 2005 Tutorials

Common Dialog Boxes / File Dialog Boxes




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

In other movies we have seen the use of the color and the font dialog boxes. In this movie I will explore the open and save dialog boxes. Once again, we need to open in the Toolbox the Dialogs Section. You will notice there is an Open File Dialog, which I'll double click and there is also a Save Dialog, which I'll also double click. Each of these items is now placed in the components tray. I have a button that is Labeled File Open and I have a button, File Save. I will allow the File Open Button to interact with the Open File Dialog One Box, a component. I'll open the File Open Button and the code will simply be to open file me.open file dialog.show dialog open close parentheses. This one line of code taps into the open dialog box that is built into the Windows environment. To demonstrate, I'll run the program. At run time I'll click the File Open Button and as you'll note, here is a familiar open dialog box, pre-written by Windows. Nothing else you need to do. You simply can allow the user now to click on the drop-down arrow and explore the various parts of the computer system as to where they might want to save a file. So click File Open and then they are able to specify the file. Now, there are some other fine tuning you could do to this. You could specify a certain file type by placing a filter, but that's beyond the scope of what this movie is going to discuss. But to get the open dialog box, very simple, one line of code. Me.open file dialog.show dialog. Now, if we return to our form and you recall I also placed the save file dialog box in the components tray so I'll associate that with the File Save Button and likewise, I'll simply type me.; this time it's save file dialog one.show dialog. Again, this one line of code will then call upon the pre-written Save As Button. So when I execute this at run time, clicking the File Save Button, here is your Save As Box. Again, it's defaulting to a debug folder but you could specify where to it be defaulted to or simply allow the user to specify a different file by typing a file name and they could specify the file type as well. So this is very simple to use to allow the user to interact with your system and to open a file or to save a file. The other common dialog boxes, the color and the font dialog boxes, are explored in separate movies.

Tutorial Information

Course: Microsoft Visual Basic 2005
Author: Arthur Lee
SKU: 33940
ISBN: 1-935320-10-6
Release Date: 2008-11-19
Duration: 7.5 hrs / 97 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available