Dialog Boxes - Using Save As, Open, Print, etc. 
Author Message
 Dialog Boxes - Using Save As, Open, Print, etc.


Dear Prince:

 > I am a beginning Visual Basic user...accually, just started
 > yesterday...and am having trouble with dialog boxes.  I put
 > one out and followed the book's instructions to make an open,
 > save, and print menu.  I try to open any file, and it pops up
 > with a box with the drive, directories, and files, but
 > doesn't do anything.  I try to save and I can see the files,
 > but can't get anything to save to the hard disk.  I try to
 > print stuff in my program and it comes up with the number of
 > copies and stuff, but then it doesn't print.

Actually, you are calling the "Windows Common Dialog" functions,
not just "dialog boxes" -- there are other kinds of user dialog
boxes.  They are working just as they are supposed to work for the
file operations -- that is, they return a file name and path; they
do not, in themselves, open or save anything.  The reason for that
is that it doesn't know what you want to do... you might be simply
wanting to open a file, but on the other hand, you might be wanting
to attach a number of different tables in a database that is
identified by the file and path name.  You'll need to use the file
name and path that are returned to perform the operation you
desire.

 > Is there something I'm doing wrong?  If it's not supposed to
 > work, then why do they have it in there???  If anyone has
 > some insight on this subject, I'd REALLY appreciate it.

(1) No, not exactly -- more like "something you are not doing", see
    above.

(2) Especially when one is just starting out, one needs to "take it
    easy" and not assume that because something isn't working _just
    as one expects it to work_ (which, as in this case, may not be
    the way its intended to work), that "it doesn't work". By the
    way, I believe that if you'll really _read_ the documentation
    and help you'll find that it does explain this; further, VB
    comes with a great many examples, at least some of which have
    similar functions that _illustrate_ how to use the functions.
    Sounds like you've jumped in "feet first" without doing all the
    necessary homework.

(3) Available from "ftp.microsoft.com", from the VB forum on
    CompuServe, and from Microsoft's Download Service BBS, there's
    a VB Knowledge Base that contains _vast_ amounts of useful
    information on subjects like this; there's also a file
    available on the Net, the VB FAQ (can't give you the address;
    don't have full Net access myself) that likely will cover this
    and many other subjects of interest.

(4) I'd bet that _most_ good VB self-study books would have
    addressed using the Windows Common Dialog control, at least to
    the depth necessary to avoid this question.  Any well-stocked
    bookstore will have a variety of them, many of them quite good,
    but some not so good as others.  I can't offer any
    recommendations, as the last VB self-study I used was for VB
    1.0, and it turned out to be (IMHO) one of the "not so good"
    ones (I won't mention it here, since it's out of date, and I've
    used some excellent books by the same publisher since, in
    other subject areas).

 Larry Linson

 A mere Commoner, but one who's spent a good deal of time with his
 back to the wall doing computer application development...
---
 t SLMR 2.1a t



Fri, 10 Jul 1998 03:00:00 GMT  
 Dialog Boxes - Using Save As, Open, Print, etc.

Blankenship) threw this at us:

Quote:
>    I am a beginning Visual Basic user...accually, just started
>yesterday...and am having trouble with dialog boxes.  I put one out and
>followed the book's instructions to make an open, save, and print menu.  I try
>to open any file, and it pops up with a box with the drive, directories, and
>files, but doesn't do anything.  I try to save and I can see the files, but
>can't get anything to save to the hard disk.

David, you're missing something very basic about the dialog box.
They don't _do_ the thing for you (save, open), they only give
you a filename with which _you_ can do whatever you want. The
Filename property of the common dialog control will give you the
filename after the user has pressed OK in the dialog box.

Happy learning, and throw that book away.

Jens
--
* Everything I said are the opinions of someone else.   *
* I just cut-and-pasted.                                *

Jens Balchen jr.       http://www.sn.no/~balchen



Fri, 10 Jul 1998 03:00:00 GMT  
 Dialog Boxes - Using Save As, Open, Print, etc.
        I am a beginning Visual Basic user...accually, just started
yesterday...and am having trouble with dialog boxes.  I put one out and
followed the book's instructions to make an open, save, and print menu.  I try
to open any file, and it pops up with a box with the drive, directories, and
files, but doesn't do anything.  I try to save and I can see the files, but
can't get anything to save to the hard disk.  I try to print stuff in my
program and it comes up with the number of copies and stuff, but then it
doesn't print.  Is there something I'm doing wrong?  If it's not supposed to
work, then why do they have it in there???  If anyone has some insight on this
subject, I'd REALLY appreciate it.

Thanks,
 Prince Valiant



Fri, 10 Jul 1998 03:00:00 GMT  
 Dialog Boxes - Using Save As, Open, Print, etc.
Welcome to the world of VB4!!...

The Common Dialog's does NOT give you the complete functionality, for
opening, saving and printing etc. files. This would be an impossible task
for Microsoft, because they have no way of knowing your fileformats etc.

The common dialogs are created by Microsoft mainly as an aid to the users
of Windows applications. The intensions was to give the users some easy
recogniseable dialogs, through all Windows applications.

Your task when you have displayed the dialog for the user, and he/she has
maid his/her choices, is to interpret these choices, ie. to save the
file, open the file or even print the file. The users choices are mostly
awailable to you as properties en your common dialog control.

Have a nice day, greetings from Stiig.



Fri, 10 Jul 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Centering a Open Dialog box using the Common dialog

2. Printing to File using Print Dialog box

3. Printing to File using Print Dialog box

4. the common dialog box (open/save mode)

5. Save & open dialog boxes

6. How to call Open File and Save As dialog box API from VB

7. Open/Save Dialog Box with API

8. SIMPLE HELP NEEDED - Saving a text file using a common dialog box

9. open dialog or save dialog

10. Open Hyperlink Dialog Box using VBA

11. problem determining file to open using common dialog box

12. Opening text file in a text box using common dialog

 

 
Powered by phpBB® Forum Software