Recent

Author Topic: SelectDirectoryDialog  (Read 1702 times)

ratmalwer

  • Jr. Member
  • **
  • Posts: 57
SelectDirectoryDialog
« on: October 22, 2017, 04:49:13 pm »
I try to preset the path before SelectDirectoryDialog. the following code is not correct but shows what I try to do.
any hints?


Code: Pascal  [Select][+][-]
  1. procedure TForm1.btnQuellpfadClick(Sender: TObject);
  2. var dir: string;
  3. begin
  4.   dir := 'p:\somepath';
  5.   if SelectDirectoryDialog1.Execute then
  6.     begin
  7.       EditQuellpfad.Caption := SelectDirectoryDialog1(dir).FileName;
  8.     end;
  9.  
  10. end;

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: SelectDirectoryDialog
« Reply #1 on: October 22, 2017, 04:58:49 pm »
try SelectDirectoryDialog1.InitialDir := 'initialdir' before calling execute, see also here.
« Last Edit: October 22, 2017, 05:00:58 pm by molly »

ratmalwer

  • Jr. Member
  • **
  • Posts: 57
Re: SelectDirectoryDialog
« Reply #2 on: October 22, 2017, 06:57:54 pm »
Thanks... that works good.

Unforunately the scrollbar does not move down to the selected directory (or the list does not rise) ....
is there an option to do that too?
(using Windows7)

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: SelectDirectoryDialog
« Reply #3 on: October 22, 2017, 07:17:03 pm »
tbh i have no idea. It might be that the OS widget is not capable of doing so.

 

TinyPortal © 2005-2018