Can I call a validating event through code?

gsxawd99

Member
Joined
Sep 10, 2005
Messages
8
Programming Experience
Beginner
Is it possible to somehow call a textbox's validating event through code? when i open a text file and load the texboxes, the validating event does not fire...is there a way i can force it to fire??? Also, once i save the text file and name it using a Save dialog box, how would I simply save the file (re-write over the existing file using the same name etc...) w/o using a dialog box?
 
Last edited:
here's how i handle overwriting files without a SFD (save file dialog)

when the user opens a file i set a boolean value (blnFileOpen) to true and a string (strFileName) to the .FileName property of the dialog

then in code when the user clicks "Save" (not Save As in this case)
I frist check to see if the file's already open (blnFileOpen)

if it is then i simply (i'm assuming you're using the streamwriter in this case)
Dim SW as New StreamWriter(strFileName, True)
and what that does is opens the file for writing, and the True means it will overwrite the current file that's there

if blnFileOpen is false then i call mnuSaveAs.PerformClick() which means the user didnt have a file open and they much pick a spot to save the data

the Save As part would use a SaveFileDialog


does this help any?
 
Back
Top