private void RenameButton_Click(object sender, EventArgs e) { NewFileNameTextBox.Text = null; NewFileNameLabel.Show(); NewFileNameTextBox.Show(); NewFileNameOkButton.Show(); }
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(); }