| > ・特定のフォルダーに XML で保存するのか
XMLに保存したいです。
CustomColors プロパティとは public int[] CustomColors { get; set; } の事ですよね?
>CustomColorsは追加した色がint配列で格納されているので
>ダイアログを閉じたときにCustomColorsを参照して適当なファイルに保存
どう参照すればいいのでしょう?
素人なので本当にわからないのですごく困ってます。
namespace ApplicationTest001
{
public partial class Form1 : Form
{
private int Form1BackColor;
//public int[] CustomColors { get; set; }
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
Form1BackColor = colorDialog1.Color.ToArgb();
BackColor = colorDialog1.Color;
}
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = Properties.Settings.Default.textBox1;
Form1BackColor = Properties.Settings.Default.Form1BackColor;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.textBox1 = this.textBox1.Text;
Properties.Settings.Default.Save();
}
}
} |