In a Visual basic.net 2010 desktop application, I am loading a list of Access 2013 files that the user needs to select to work with. The code listed below is correct but the file names are too long for the combo box.
Here is the code:
Try
Dim dirAccessFiles As String() = Directory.GetFiles("H:\FilesTest", "*.accdb")
Dim dir As String
For Each dir In dirAccessFiles
cboAccessFile.Items.Add(dir)
Next
Catch except As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try
Thus I have the following questions to ask you:
1. If there is a way to expand the size of the combo box values while the application is executing, can you show me how to do that?
2. Right now in dropdownlist box, the values look like,
'H:\Testfiles\Diane__Currentyear.accdb'.
I would like the value only of 'Diane__Currentyear' that is listed above to display. Also where hardcoded value of 'H:\Testfiles' is displayed in the code above, I will get the actual value from the app. config file.
Thus would you show the code on how to display only the value of 'Diane__Currentyear' in the list of combo box values?