Im trying to populate a combobox with a list of the drives located in "My Computer"
So each drive would have an item and text
How would I go about doing this?
Printable View
Im trying to populate a combobox with a list of the drives located in "My Computer"
So each drive would have an item and text
How would I go about doing this?
Call DriveInfo.GetDrives and bind the result to your ComboBox.
Oops! Just after I posted I realised that you're using .NET 1.1 so the DriveInfo class is not available to you.
LAME! lol I was getting excited because I'd never heard of a driveInfo class
It's in the Environment class, been there since .Net 1.0 (VS 2002):
What you can do is bind the ComboBox to the Environment.GetLogicalDrives array and there ya go.Code:For Each Drive As String In Environment.GetLogicalDrives
MessageBox.Show(Drive)
Next Drive
Thank you very much. Works great now :D