private void tileRefColorsToLibraryButton_Click(object sender, EventArgs e) { string tilename = Path.GetFileNameWithoutExtension(currentTileName); using (TilePrompt dlg = new TilePrompt()) { dlg.TileName = tilename; if (dlg.ShowDialog() == DialogResult.OK) { tilename = dlg.TileName; TileRefColorsToLibrary(tilename); LibraryToTreeview(); } } }