private void DeleteFileBtn_Click(object sender, EventArgs e) { if (LoadedFIlesCBox.SelectedIndex != -1) { int fileID = ((KeyValuePair <int, string>)LoadedFIlesCBox.SelectedItem).Key; httpClient.DeleteFile(fileID); LoadedFIlesCBox.Text = ""; LoadedFIlesCBox.SelectedIndex = -1; UpdateFilesList(); } }