OpenFileDialog and .lnk .url files

  • Thread starter Thread starter jonpb
  • Start date Start date
J

jonpb

Hi,
Is there some way to force the OpenFileDialog NOT to display shortcuts
like .lnk and .url files when I have specified a filter, for instance:
"DWG files|*.dwg|DXF files|*.dxf"

Thanks
 
Is there some way to force the OpenFileDialog NOT to display shortcuts
like .lnk and .url files when I have specified a filter, for instance:
"DWG files|*.dwg|DXF files|*.dxf"

Just a guess, but try setting the DereferenceLinks property to false.
 
Jeff said:
Just a guess, but try setting the DereferenceLinks property to false.

Nope. Just another quick question, is this supposed to be a "feature"?
If so, could someone explain it to me.
 
Nope. Just another quick question, is this supposed to be a "feature"? If
so, could someone explain it to me.

What if you were developing a program to examine the guts of .lnk files
(shortcuts)? You'd want to actually open THAT file, but the default behavior
of the common dialogs is to FOLLOW the shortcut to its target, not open the
physical .lnk file. This property allows you to turn off this default
behavior.

Wait, maybe that wasn't the question you were asking. If you were asking
about why you still see shortcuts when you specify a filter, I'd say yes,
because the shortcuts COULD point to one of the files in your filter. It's
the same concept behind continuing to display folders, because one of those
types of files might be in a subfolder.
 
Back
Top