예제 #1
0
 private void RenameButton_Click(object sender, EventArgs e)
 {
     NewFileNameTextBox.Text = null;
     NewFileNameLabel.Show();
     NewFileNameTextBox.Show();
     NewFileNameOkButton.Show();
 }
예제 #2
0
        private void NewFileNameOkButton_Click(object sender, EventArgs e)
        {
            string oldFilePath = GetSelectedFilesPath();
            string newFilePath = CurrentPath + NewFileNameTextBox.Text;

            try
            {
                File.Move(oldFilePath, newFilePath);
            } catch { MessageBox.Show("You cannot leave it blank.", "Rename error", MessageBoxButtons.OK, MessageBoxIcon.Error); }

            RefreshPage();
            NewFileNameLabel.Hide();
            NewFileNameTextBox.Hide();
            NewFileNameOkButton.Hide();
        }