Solved

Allow only picture files in OpenDialog

Posted on 2004-04-27
3
233 Views
Last Modified: 2010-04-05
Hi,

how can I set an OpenDialog to only accept picture files? The OpenDialog should only allow to open .bmp and .jpg files.
When I set the DefaultExt nothing happens...


thanks
0
Comment
Question by:Bohne
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 50 total points
ID: 10930855
1. You can use OpenPictureDialog
or
2. You should set property
Filter := All (*.*)|*.*|JPEG Image File (*.jpg)|*.jpg|JPEG Image File (*.jpeg)|*.jpeg|Bitmaps (*.bmp)|*.bmp;
0
 
LVL 17

Expert Comment

by:mokule
ID: 10930867
DefultExt property is for adding extension to a file name when entered without extension and period.
0
 
LVL 2

Expert Comment

by:Deti
ID: 10931492
Just write that String with mokule wrote in OpenDialog Filter.. in Object Inspector..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE2 application frozen on Windows 10 10 277
Convert Jpg /PNG To GIF 5 120
Best Firemonkey component pack 1 88
Working this component WebCopy with proxy, help 3 76
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now