473,473 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

customizing OpenFileDialog

2 New Member
Hi,

I want to customize FileOpenDialog ,such a way that it will only show folders and should start with some string.


Thanks
Nov 4 '08 #1
6 2093
r035198x
13,262 MVP
I don't think that's possible. Google for BrowseForFolder.
Nov 4 '08 #2
tlhintoq
3,525 Recognized Expert Specialist
You do realize that you haven't asked a question, don't you?
Posting guidelines for how to ask a question

You have stated something that you want to do. Ok. Go do it. You don't have to ask permission.

On the other had I *do* have a question. What good will an Open*FILE*Dialog do for you if you do manage to modify this sealed class to only show only *FOLDERS*? Personally, I think I would use a FolderBrowserDialog for purposes where I only wanted to see folders.

Of course, that's a sealed class too. So you can't modify it or even use it to device a new class that you could modify. So if you are married to the idea of filtering the folders it displays, you'll have to create your own dialog from scratch.
Nov 4 '08 #3
saeedbadar
1 New Member
I think you cannot resize the FileDialog in .Net directly.

There is a protected method 'HookProc' in all dialogs. This method provides you access to dialog creation process. But the OpenFileDialog is sealed. So you will not be able to use it directly. You need to use windows API's that support this method. I found this link...
http://www.codeproject.com/KB/cs/get...?display=Print

Another relatively easy solution you can find at:
http://www.codeproject.com/KB/dialog...eDialogEx.aspx
Nov 4 '08 #4
vanc
211 Recognized Expert New Member
Hi,

I want to customize FileOpenDialog ,such a way that it will only show folders and should start with some string.


Thanks
How can FileOpenDialog just show folder? It's file open dialog, it has to show files to open files. I think you're messing with some confusing ideas here, if you want it to show only some type of file, use Filter, if you want it starts with MyComputer then using SpecialFolder.

Cheers.
Nov 5 '08 #5
joedeene
583 Contributor
Why wouldn't the FolderBrowserDialog help? If you want to show just folders, but I'm not quite clear on the part you said:
...and should start with some string...
joedeene
Nov 5 '08 #6
tlhintoq
3,525 Recognized Expert Specialist
Hi,

I want to customize FileOpenDialog ,such a way that it will only show folders and should start with some string.

Thanks
The original post was to
  • MODIFY a FileOpenDialog, which can't be done since its a sealed class.
  • Have it show *only* folders. - For what reason we don't know.
  • *Limit* the folders to those starting with a speficied letter.

Nobody said anything about resizing it, or starting it at a specified directory.

Rithm: To do what you describe will require you to make your own control from scratch. As suggested a couple times previously, if you just need to browse folders instead of files, there is a component that already does that: The FolderBrowserDialog

I don't think there's anything else anyone here can tell you without you supplying a different question or set of needs.

Regards,
tlhIn'toQ
Nov 5 '08 #7

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...
3
by: seash | last post by:
Hi I need an OpenFileDialog with my own gui of the dialog box. i want to use the functionality given by the object of the OpenFileDialog component with my own dialogbox....have any ideas... Is it...
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?
6
by: barbara_dave | last post by:
Hi, All, I want to use the openfiledialog to open different extension files in different directory( only one type files at one time). I set the OpenFiledialog InitialDirectory and Filter...
2
by: stand__sure | last post by:
I have noticed that many apps control the icons in the left-side pane of the OpenFileDialog (to show folders like "My Documents" or "My Pictures"), but I see no way to control this through the...
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...
1
by: sam | last post by:
OpenFileDialog appears to be "holding onto" the parent folder of a selected file until the application using the dialog quits. After creating a folder containing a file, I attempted to select...
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....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.