So, I had to use a Listbox for a small C# project, and ran into a problem. The Listbox displays file-names, and an item is added every-time someone uses a File Dialog box to add in the item. The problem is when the very first file is added, nothing shows up. but when a second file is added, its an empty line.
Here is a picture to illustrate the problem:

Now, how do I get rid of the first blank line and properly add in the filename to the top of the listbox?
Here is the code that I am using to add to the listbox.
// Set a global variable to hold all the selected files result
List<String> fullFileName;
private void addBtn_Click(object sender, EventArgs e)
{
DialogResult result = fileDialog.ShowDialog(); // Show the dialog.
if (result == DialogResult.OK) // Test result.
{
// put the selected result in the global variables
fullFileName = new List<String>(fileDialog.FileNames);
// add just the names to the listbox
foreach (string fileName in fullFileName)
{
dllBox.Items.Add(fileName.Substring(fileName.LastIndexOf(@"\") + 1));
}
}
}
And here is the properties for fileDialog:

As well as the dllBox properties

Try changing your DrawMode to Normal rather than OwnerDrawFixed in the listbox properties.