我有一个带有项目的组合框(使用 opendialog 打开文件的路径)。
截图 http://screenshotuploader.com/i/01/0k8n94fka.png
如何在 combobx 预览中仅显示文件名?
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Title = "Выбрать фаил для загрузки";
openFileDialog1.InitialDirectory = System.Environment.CurrentDirectory;
openFileDialog1.Multiselect = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
foreach (String file in openFileDialog1.FileNames)
{
comboBox1.Items.Add(file);
}
}