Sie Ste

Sie Ste

  • 1.8k
  • 196
  • 155.9k values displayed in a combo box

Jun 8 2015 5:42 PM

In a Visual 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: 

Dim dirAccessFiles As String() = Directory.GetFiles("H:\FilesTest", "*.accdb")

Dim dir As String

For Each dir In dirAccessFiles



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,
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? 

Brought to you by:

Answers (4)