need "save as" code 
Author Message
 need "save as" code

Looking for some sample code for saving a couple of text box's to the hard
drive. Including save, save as, open, overwrite?, and save changes?. Using
VB4.

______________________________________________________

David Bigandt
Las Vegas

http://www.*-*-*.com/ ~davidb/



Sat, 17 Mar 2001 03:00:00 GMT  
 need "save as" code
Do mean save the value of a text box (text prop) or the entire text box
(i.e.) all the props.

For the former it might be easier to write to the INI or registry for just
the few chars in a text box. Otherwise you need code to open a file (maybe
via the comm control) then write n records of text as UDTs so you can use
get/put to get the correct record (say rec 1 is text1, rec 2 is text2, etc.)
Also note multi-record text files have to have fixed length UDTs (String *,
not string). Look in VB's help for info on random files.

If you want to save all the props you need to make a UDT with all the props
so you can restore latter.

Quote:

>Looking for some sample code for saving a couple of text box's to the hard
>drive. Including save, save as, open, overwrite?, and save changes?. Using
>VB4.

>______________________________________________________

>David Bigandt
>Las Vegas

>http://www.wizard.com/~davidb/



Sat, 17 Mar 2001 03:00:00 GMT  
 need "save as" code
You can accomplish these tasks using the common dialog control.
If the user opens a file, store the filename for use with the
Save command.  If the user selects Save, but there is no filename
stored, call the SaveAs function instead.

Im not sure what you intended SaveChanges to do, it seems this would
be covered by using one of the other two save routines.

To determine if the text has changed, set a flag in the textbox change
event and clear it in the open or save routines.  Before exiting, in
the QueryUnload event, test the flag and prompt the user if the changes
have not been saved.

You can use the Flag property of the dialog box to force a confirmation
prompt if the user selects a filename already in use:

cdlOFNOverwritePrompt ( = 2&)

Since these are common commands in most applications, you might put the
code in a module, or class, so that it can be easily ported to your other
programs.

LFS

Quote:

> Looking for some sample code for saving a couple of text box's to the hard
> drive. Including save, save as, open, overwrite?, and save changes?. Using
> VB4.

> ______________________________________________________



Sat, 17 Mar 2001 03:00:00 GMT  
 need "save as" code
There's a great text editor sample on the CD. Let me know if you want me to
e-mail it to you.
remove the obvious from the address.
HK
Quote:

>Looking for some sample code for saving a couple of text box's to the hard
>drive. Including save, save as, open, overwrite?, and save changes?. Using
>VB4.

>______________________________________________________

>David Bigandt
>Las Vegas

>http://www.wizard.com/~davidb/



Sat, 17 Mar 2001 03:00:00 GMT  
 need "save as" code
Well this strikes a question from me now.
If I have a picture box and just say that I have a code that loads a image in
that box like ( Form1.Open.Picture = LoadPicture(Label1.Caption)  ).
How would I go about doing a save as for it.
Thanks


Sun, 18 Mar 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. need "save as" code

2. need "save as" code

3. need "save as" code

4. code to "save as"

5. Newbie needs help with "findfile-code"

6. Need simple code to highlight (or change colour boldness) of anything in ""'s

7. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

8. Disabling "save" or "save as" on a form

9. "Save" and "Save As"

10. Morse Code Program - Need help with "timing" or "speed"

11. Morse Code Program - Need help with "timing" or "speed"

12. GetObject("","InternetExplorer.Application") fails in Excel VBA

 

 
Powered by phpBB® Forum Software