[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 954
  • Last Modified:

Open folder

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
pipinana2002
Asked:
pipinana2002
  • 2
  • 2
  • 2
1 Solution
 
kretzschmarCommented:
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
 
snehanshuCommented:
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
 
pipinana2002Author Commented:
Hi meikl..

Thanks for your help :)

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

Thanks againn.. :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
snehanshuCommented:
Thanks meikl,
  I did not know about that!
  pipinana2002: you have the solution from the best.
:-)
...Snehanshu
0
 
pipinana2002Author Commented:
Hi again meikl.. I already found how to do it.. hehehehehe thanks a lot for your helpp :):):) U're really great! :)
0
 
kretzschmarCommented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now