コード例 #1
0
        private void logfileform_Load(object sender, EventArgs e)
        {
            Properties.Settings.Default.Reload();
            this.Location = Properties.Settings.Default.LogFormLocation;

            Locationtxtbox.Text = Properties.Settings.Default.LogPathName;
            Locationtxtbox.Update();
        }
コード例 #2
0
        private void SetDirectoryBtn_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fd2 = new FolderBrowserDialog();

            if (fd2.ShowDialog() == DialogResult.OK)
            {
                Locationtxtbox.Text = fd2.SelectedPath;
                Locationtxtbox.Update();
                Properties.Settings.Default.LogPathName = Locationtxtbox.Text;
                Properties.Settings.Default.Save();
            }
            else
            {
                MessageBox.Show("Folder not specified, default to C:\\", "No folder selected", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                Locationtxtbox.Text = "C:\\";
                Locationtxtbox.Update();

                Properties.Settings.Default.LogPathName = Locationtxtbox.Text;
                Properties.Settings.Default.Save();
            }
        }