Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 152477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:37:49+00:00 2026-05-11T09:37:49+00:00

I remember in vb6 there was a control that was similar to a dropbox/combobox

  • 0

I remember in vb6 there was a control that was similar to a dropbox/combobox that you can select the drive name. It raises an event which you can then set another control which enumerate files in listbox. (in drive.event you do files.path = drive.path to get this affect).

Is there anything like this in C#? a control that drops down a list of available drives and raises an event when it is changed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:37:50+00:00Added an answer on May 11, 2026 at 9:37 am

    There’s no built-in control to do that, but it’s very easy to accomplish with a standard ComboBox. Drop one on your form, change its DropDownStyle to DropDownList to prevent editing, and in the Load event for the form, add this line:

    comboBox1.DataSource = Environment.GetLogicalDrives(); 

    Now you can handle the SelectedValueChanged event to take action when someone changes the selected drive.

    After answering this question, I’ve found another (better?) way to do this. You can use the DriveInfo.GetDrives() method to enumerate the drives and bind the result to the ComboBox. That way you can limit which drives apppear. So you could start with this:

    comboBox1.DataSource = System.IO.DriveInfo.GetDrives(); comboBox1.DisplayMember = 'Name'; 

    Now comboBox1.SelectedValue will be of type DriveInfo, so you’ll get lots more info about the selected game. And if you only want to show network drives, you can do this now:

    comboBox1.DataSource = System.IO.DriveInfo.GetDrives()     .Where(d => d.DriveType == System.IO.DriveType.Network); comboBox1.DisplayMember = 'Name'; 

    I think the DriveInfo method is a lot more flexible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I remember reading somewhere (maybe someone can help remember where), that there is a
I remember there is some build-in application that I can use to download websites.
First: sorry for my poor English writing. I remember that in VB6.0 days, we
I remember in symfony 1.x there was a "currency" field type, which was a
Fairly straightforward question: How can I tell a VB6 application to remember what display
I remember hearing somewhere that large functions might have higher execution times because of
I remember seen some code xaml where can get the first element (like an
I remember reading somewhere that Hadoop's performance deteriorates significantly if the machines it runs
I remember that it was (still is?) necessary in MonoTouch to keep explicit references
We have a VB6 project that compiles to an ActiveX EXE that happens to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.