vb.net - Save file path on show dialog -
i want save path on text box after directory 1: whenever try close application , open again path not there.i want show every time open application.
private sub btnrootbrowse1_click(sender system.object, e system.eventargs) handles btnbrowse1.click rootfolderbrowserdialog.showdialog() txtpath1.text = rootfolderbrowserdialog.selectedpath end sub
you need save data (in case txtpath1.text) hard-drive (file or database) , reload in next execution.
can easy when use application-setting:
- in solution explorer, double-click "my project"
- in left pane click "setting"
- in table, fill in fields needed, example case: name: directorylocation type: string scope: user value: empty.
sample code using:
public sub new() initializecomponent() 'load hard-disk txtpath1.text = my.settings.directorylocation end sub private sub btnrootbrowse1_click(sender system.object, e system.eventargs) handles btnbrowse1.click rootfolderbrowserdialog.showdialog() txtpath1.text = rootfolderbrowserdialog.selectedpath 'save hard-disk my.settings.directorylocation = txtpath1.text my.settings.save() end sub
Comments
Post a Comment