Vielen Dank für Eure Antworten! :-*
Mit dem Post von Popov konnte ich mein Problem lösen.
Code:
procedure TForm1.CheckBox1Click(Sender: TObject);
var
St1: String;
Int1, Int2: Integer;
begin
if CheckBox1.Checked = True then
begin
if Edit1.Text[1] <> '\' then
begin
Edit2.Enabled := True;
St1 := Edit1.Text;
Int1 := PosEx(':\', St1, 0);
Int2 := PosEx(':\', St1, Int1 + 1);
if Int2 > Int1 then Edit2.Text := ExtractFilePath(Copy(St1, 1, Int2 - 1))
else Edit2.Text := ExtractFilePath(St1);
end
else Edit2.Text := ExtractFilePath(Edit1.Text);
ActiveControl := Edit2;
end
else
begin
Edit2.Enabled := False;
Edit2.Text := ' override working path...';
end;
end;
"C:\Hey.Hello There\You.exe C:\Ok.Bye Then\You.exe"
= "C:\Hey.Hello There\"