Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Settings/MainForm.cs @ 810

Last change on this file since 810 was 775, checked in by swagner, 16 years ago

Experimented with the .NET application settings framework (#7)

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8
9namespace HeuristicLab.Settings {
10  public partial class MainForm : Form {
11    private Properties.Settings settings;
12
13    public MainForm() {
14      InitializeComponent();
15    }
16
17    private void MainForm_Load(object sender, EventArgs e) {
18      settings = Properties.Settings.Default;
19      textBox1.Text = settings.MyApplicationSetting;
20      textBox2.Text = settings.MyUserSetting;
21    }
22
23    private void button1_Click(object sender, EventArgs e) {
24      settings.Save();
25    }
26
27    private void textBox1_TextChanged(object sender, EventArgs e) {
28      settings.MyApplicationSetting = textBox1.Text;
29    }
30
31    private void textBox2_TextChanged(object sender, EventArgs e) {
32      settings.MyUserSetting = textBox2.Text;
33    }
34
35    private void button2_Click(object sender, EventArgs e) {
36      settings.Reload();
37      textBox1.Text = settings.MyApplicationSetting;
38      textBox2.Text = settings.MyUserSetting;
39    }
40  }
41}
Note: See TracBrowser for help on using the repository browser.