选中TextBox控件,在属性窗格中找到(ApplicationSettings),然后设置它。
绑定配置文件
private Settings settings = new Settings(); private void MainForm_Load(object sender, EventArgs e) { this.txtTargetInitialCatalog.Text = settings.sadbname; } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { settings.sadbname = this.txtTargetInitialCatalog.Text; settings.Save(); }