Solved

Open folder

Posted on 2003-11-19
6
941 Views
Last Modified: 2008-02-01
Hi.. I'm using Delphi 6 in Windows XP, and I want the user to choose the folder name in which he will use the data in that folder as the database. I want to get the folder name which the user has chosen.. Is it using Open Dialog Box or using something else? Any help will be very much appreciated :) Thanksss..
0
Comment
Question by:pipinana2002
  • 2
  • 2
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 9785043
there is a selectdirectory-function

a sample

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses filectrl; //filectrl is used

procedure TForm1.Button1Click(Sender: TObject);
var s : string;
begin
  s := '';
  if selectdirectory(s,[],0) then
    showmessage('Directory '+s+' is selected');
end;

end.

meikl ;-)
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 9785061
pipinana2002,
  You could use:
1) TDirectoryListBox from Win3.1
2) TDirectoryEdit from RX components (http://sourceforge.net/projects/rxlib/)
  for selecting folder names.
HTH,
...Snehanshu
0
 

Author Comment

by:pipinana2002
ID: 9785070
Hi meikl..

Thanks for your help :)

Can I actually remove the files and drives list from the display?

Thanks againn.. :)
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 5

Expert Comment

by:snehanshu
ID: 9785072
Thanks meikl,
  I did not know about that!
  pipinana2002: you have the solution from the best.
:-)
...Snehanshu
0
 

Author Comment

by:pipinana2002
ID: 9785091
Hi again meikl.. I already found how to do it.. hehehehehe thanks a lot for your helpp :):):) U're really great! :)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9785271
glad you got it,

to use another dialog-style,
just use the other syntax

procedure TForm1.Button1Click(Sender: TObject);
var s : string;
begin
  s := '';
  if selectdirectory('Select A Directory','',s) then
    showmessage('Directory '+s+' is selected');
end;

meikl ;-)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

15 Experts available now in Live!

Get 1:1 Help Now