private void profileEditButton_Click(object sender, EventArgs e) { int select = profiles[profilesListBox.SelectedIndex - 1].id; EditProfileForm edit = new EditProfileForm(select); edit.Show(); }
private void profileEditButton_Click(object sender, EventArgs e) { string profileid = profiles.Find(x => x.username == profilesListBox.SelectedItem.ToString()).id; string path = Path.Combine(Globals.profilesFolder, profileid + ".json"); if (Application.OpenForms.OfType <EditProfileForm>().Count() == 0 && File.Exists(path)) { EditProfileForm edit = new EditProfileForm(profileid, this.Location); edit.Show(); } }