Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips


#166: How can I change the view style in OpenDialog/SaveDialog?

Friends,
we all uses the TOpenDialog/TSaveDialog to open the directory with files. By default, the file list there displayed in LIST mode.

If you need change this style (for example, for picture tool you may use the thumbnail mode), execute the next code in OnFolderChange event for dialog instance:

procedure TForm1.OpenDialog1FolderChange(Sender: TObject);
const
  FCIDM_SHVIEW_LARGEICON = $7029;
  FCIDM_SHVIEW_SMALLICON = $702A;
  FCIDM_SHVIEW_LIST = $702B;
  FCIDM_SHVIEW_REPORT = $702C;
  FCIDM_SHVIEW_THUMBNAIL = $702D;
  FCIDM_SHVIEW_TILE = $702E;
var
  newStyle: dWord;
begin
  newStyle := FCIDM_SHVIEW_THUMBNAIL;
  SendMessage(FindWindowEx(GetParent(OpenDialog1.Handle), 0, 'SHELLDLL_DefView', nil), WM_COMMAND, newStyle, 0);
end;

As you see from sample, the thumbnail mode will be used always in TOpenDialog. The const values for all available styles declared in function above too.


Published: August 23, 2005

See also
 
Fast Document Viewer
Clarion to Text converter/a>
Database Information Manager
Excel Web-stream
ExcelFile Viewer
Paradox to Text converter
Excel Reader (dll)
Viewer for MS Outlook Messages
Paradox ActiveX
Clarion Viewer
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2017, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMReport Autogenerated