vb.net - Saving to text not showing anything in 'save file type' -
hi trying save text file rich text box following code , not saving , not giving option save file type when saving prompt comes up:
private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click dim sfd new savefiledialog sfd.showdialog() dim mypath string = sfd.filename fileopen(1, "mypath", openmode.output) printline(1, richtextbox1.text) fileclose(1)
try ...
private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click dim sfd new savefiledialog dim filename string = "" dim mysafefilename string = "" try sfd .initialdirectory = "d:\mypath\data" ' --> put yor full path here .filename = mysafefilename .filter = "text files (*.txt)|*.txt|" if .showdialog() = dialogresult.ok filename = .filename fileopen(1, filename , openmode.input) printline(1, richtextbox1.text) fileclose(1) end if end catch ex system.exception msgbox(ex.message) end try end sub
Comments
Post a Comment