473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Working with customized OpenFileDialog

Hi

I'm having a problem trying to get a customised OpenFileDialog() to fulfil my requirements.
The code for this custom-built dialog has been taken from another site (http://www.codeproject.com/KB/dialog...gExtender.aspx) ) and allows the user to select the
viewing method before opening the dialog to show a file directory.

The following event is assigned to a button on my form which, when prompted, displays the dialog.

Expand|Select|Wrap|Line Numbers
  1. public void ShowOpenDialog(object sender, System.EventArgs e)
  2. {
  3.     new OpenFileDialog().ShowDialog();
  4. }
  5.  
There is also an Enum which priovides an option to the user to choose a viewing type (i.e - Icons, Tiles, Thumbnails, List, Details). This enum is driven by a seperate dialogue that is shown to the user as a drop-down list which they must select from before they open the OpenFileDialog(), using the
following method:

Expand|Select|Wrap|Line Numbers
  1. public void SelectedIndexChanged(object sender, System.EventArgs e)
  2. {
  3.     _extender.DialogViewType = (FileDialogExtender.DialogViewTypes)_cmbViewType.SelectedItem;
  4. }
  5.  
I want to show a thumbnail view and as you might or might not know, the OpenFileDialog does not contain a property to assign this as a default. I am able to get the OpenFileDialog showing Thumbnail view (by not creating an instance of OpenFileDialog) but it will not let me:

a) Do this by default
b) Create an instance of OpenFileDialog and use its properties e.g. .FileName
b) Allow me to assign the name of the file, selected by the user, to an instance variable.

If you could give me guidance with one or any of these issues, that would be appreciated.

If you would like me to show more code, please let me know.

Thanks
Matt.
May 5 '09 #1
0 2099

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: bobrad | last post by:
MAYBE SOMEBODY CAM HELP I AM USING THE FOLLOWING CODE TO GET A LOCATION OF A FILE IN A WINFORM DIALOG OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog.Filter = " Access...
2
by: don | last post by:
has anyone experienced problems with interactions between OpenFileDialog and FileStream? When I select "open" from an OpenFileDialog the subsequent calls to FileStream do not create a file. If I do...
4
by: Nagachandra Sekhar Grandhi | last post by:
I am facing a problem with OpenFileDialog. It is as follows. I opened OpenFileDialog dialog box and selected a folder in it. After selecting the folder when i tried to delete the same folder in...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
2
by: Gary Nastrasio | last post by:
I'm using the OpenFileDialog class in my application and this changes my current working directory (cwd) when a user selects a file to open. Using MC++, how can I store my cwd into a String and...
2
by: Greg | last post by:
I'm a bit confused by this - when I set the InitialDiretory of an OpenFileDialog to be a subfolder within the same folder as the app, the file dialog does not initially display the folder - instead...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
3
by: Martijn Mulder | last post by:
It strikes me that System.Windows.Forms.OpenFileDialog seems te 'remember' which directory it was in last, even when a new OpenFileDialog-object is created for every access to the file system....
2
by: sdanda | last post by:
Hai, I am working on vb.net windows application. In my application(Sample) I created some forms.In one form I am using controls OpenFileDialog, a button called as Browse and a textbox control.If I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.