Solved

Common Dialog - set default view to thumbnail...

Posted on 2002-07-12
1
662 Views
Last Modified: 2008-03-17
Here's my code and everything works fine except I can't seem to find a way to set the default view to thumbnail on a commondialog call.  I've found a few API examples but don't have the luxury of using an api call since it is instanciated with vbscript object tag and called with javascript...

<object id="cdlg" classid="clsid:F9043C85-F6F2-101A-A3C9-08002B2F49FB" width="32" height="32" VIEWASTEXT>
    <param name="FileName" value="*.*">
    <param name="Filter" value="Pictures(*.bmp;*.gif;*.jpg)|*.bmp;*.gif;*.jpg|All files|*.*">
</object>

<SCRIPT language="javascript">
function selectFile(imgCtrl)
{          
   var initialDir = "[somepath]";
   cdlg.InitDir = initialDir;
         
   cdlg.showopen();
   var file=cdlg.filename;
   ctrlNm = imgCtrl.id;
   document.all(ctrlNm).src = file;
}
   
</SCRIPT>

DOES ANYONE KNOW OF THE PROPERTY OR HOW TO ACCESS THE METHOD/PROPERTY TO SET THE VIEW TO THUMBNAIL INSTEAD OF LISTVIEW for a common dialog etc.?
0
Comment
Question by:funke
1 Comment
 
LVL 10

Accepted Solution

by:
zvonko earned 200 total points
ID: 7150852
Hello funke,

I do not think that this property exists.

This I do for two reasons:
1.) Compatibility to systems not displaying Thumbnail Icons (WinNT)
2.) Every directory can have own setting to List or Icons

You can force all directories to have same setting in Explorer, but when not general set and this control is active then you can go trough several directories with different list options.

Look yourself for available properties here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/dt_vbctlCommonDialogControlOpenSaveAsDialog_P.asp

Good luck,
zvonko

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
age from date of birth 4 43
How do specify keydowns in JavaScript 3 47
How to make a moving character 3 59
insert a falling animation of heart  in php 4 24
This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question