0

I have some basic code for opening an OpenFileDialog.

        OpenFileDialog dlg = new OpenFileDialog();
        dlg.DefaultExt = ".csv";
        dlg.Filter = "FileType|*.csv";
        dlg.Multiselect = false;
        bool? result = dlg.ShowDialog();

It works fine, but my Windows 7 users are complaining that the mouse scroll wheel doesn't scroll the list of files. I think the reason for this is that the initial focus is on the text field for the file name. If I click on the list of files, they become scrollable. How can I set the initial focus in the OpenFileDialog to be the list of files instead of the textbox?

Donn Hardy
  • 21
  • 5
  • At a glance, maybe you can find your answer here: http://stackoverflow.com/questions/6093012/customizing-openfiledialog it may be more than you wanted to actually do, though. – Ori Nachum Feb 15 '17 at 16:46
  • IIRC, you would have to pre-select a file by setting the FileName property, not often very practical. Or recommend they update to Windows 10. – Hans Passant Feb 15 '17 at 17:02
  • I couldn't replicate the problem, the scrool works pretty well here, win10, wich windows your users are using? – andrepaulo Feb 15 '17 at 17:10
  • Wow. Forgot that my development computer is a Win7. Apparently, so is the one my customer is using. – Donn Hardy Feb 15 '17 at 17:16
  • but could you reproduce this behaviour? – andrepaulo Feb 15 '17 at 18:15
  • I can't scroll without clicking on my Win7 machine. I can on my Win10 machine. My users have accepted this as an answer, but I'm still curious if it can be done on a Win7 machine. – Donn Hardy Feb 15 '17 at 19:31

0 Answers0