472,356 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,356 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 1948

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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.