Solved

Allow only picture files in OpenDialog

Posted on 2004-04-27
3
230 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

26 Experts available now in Live!

Get 1:1 Help Now