- Window Example Form
- Settings.settings 설정
- Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace UserSettingDemo { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Text = Properties.Settings.Default.Title; chkRememberPassword.Checked = Properties.Settings.Default.CheckBox; lblValue.Text = Properties.Settings.Default.Label; txtValue.Text = Properties.Settings.Default.TextBox; this.Location = new Point(Properties.Settings.Default.PX, Properties.Settings.Default.PY); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.CheckBox = chkRememberPassword.Checked; Properties.Settings.Default.Title = txtTitleForm.Text; Properties.Settings.Default.Label = txtValue.Text; Properties.Settings.Default.TextBox = txtValue.Text; Properties.Settings.Default.PX = this.Location.X; Properties.Settings.Default.PY = this.Location.Y; Properties.Settings.Default.Save(); } private void btnSetTitleForm_Click(object sender, EventArgs e) { this.Text = txtTitleForm.Text; } private void btnSetValueLabel_Click(object sender, EventArgs e) { lblValue.Text = txtValue.Text; } } } | cs |
'Programming > C# ' 카테고리의 다른 글
[C#] .ini File Read & Write (0) | 2019.01.15 |
---|---|
[Invoke & BeginInvoke] 1. 다른 Thread 에서 UI 접근하기(2) (0) | 2018.08.29 |
[Invoke & BeginInvoke] 1. 다른 Thread 에서 UI 접근하기 (1) (1) | 2018.08.29 |