I want to save path on text box after Directory 1: whenever I try to close the application and open again the path is not there.I want it to show every time I open the application.
Private Sub btnRootBrowse1_Click(sender As System.Object, e As System.EventArgs) Handles btnBrowse1.Click
RootFolderBrowserDialog.ShowDialog()
txtPath1.Text = RootFolderBrowserDialog.SelectedPath
End Sub
You need save your data (in this case txtPath1.Text) to Hard-Drive (File or DataBase) and reload it in the next execution.
It can be easy when you use Application-Setting :
Sample Code Using:
Public Sub New() InitializeComponent() 'load from the hard-disk txtPath1.Text = My.Settings.DirectoryLocation End Sub Private Sub btnRootBrowse1_Click(sender As System.Object, e As System.EventArgs) Handles btnBrowse1.Click RootFolderBrowserDialog.ShowDialog() txtPath1.Text = RootFolderBrowserDialog.SelectedPath 'save to hard-disk My.Settings.DirectoryLocation = txtPath1.Text My.Settings.Save() End Sub
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.