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
 
ABA Database Convert
DBISAM Viewer
Protected Storage Viewer
ABA Document Convert
SMMsg suite
Clarion Viewer
MAPIMail
Clarion to Text converter
SMReport
ABA Spreadsheet Convert
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

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

SMExport/SMImport suites