We help IT Professionals succeed at work.

Updating a drivecombobox

rafy
rafy asked
on
Medium Priority
618 Views
Last Modified: 2010-04-03
I'm using a drivecombobox on a form and would like to be able to update it by pressing a button.

When I say update, I mean that I mapped to a network drive while the program is already running, and would like my application to detect this new drive without me having to close and reopen the application.

If there is a way to detect the change and update without even having to associate it to a button... even better.

Thanks in advance
Comment
Watch Question

Try this:
Maybe in OnTimer()....or you think of something...

DriveComboBox1.Update;//Updates and if there are new drives it will detect it hopefully...

Viktor Ivanov

Author

Commented:
Nope update doesn't do it... it only repaints the object...
Hey Rafy try  DlgDirListComboBox() in Win32 and see if that helps. You will have to look at the command yourself but it has the ability to add all the current Drives, Directories etc.

You may have to call  CB_RESETCONTENT to clear the drive box first and reset it and then use the first procedure I mentioned. See if it helps...

WESTY :)

Author

Commented:
No... too messy...

I already found a much better solution... delete and recreate the object....Works for me.

Consider this question deleted (I'd delete it but I don't see that option).
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.