here RAD 11.1, TOpenDialog dont use any sort result!
// natural ordem on MSExplorer list if OpenDialog1.Execute then Memo1.Text := OpenDialog1.Files.Text;
as you know, "Files" is a "TStrings", then you can sort it if you need!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
Now if you WANT "controls" the "list-items", then you need do it in
Vcl.Dialogs.TOpenDialog.OnIncludeItem event... <---- here! NOTE: OLD PROBLEM with use this event... dont waste your time!
maybe, in "Vcl.Dialogs.TOpenDialog.OnSelectionChange" event to show on screen!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
procedure TForm1.Button1Click(Sender: TObject); begin if OpenDialog1.Execute then Memo1.Lines.AddStrings(MyList); end;
procedure TForm1.OpenDialog1SelectionChange(Sender: TObject); begin // you need controls if the file already exists on list.... // // procedure MyListControlIfFileAlreadyExists( MyList...) // if (MyList.IndexOf( xxxFileName) = -1) then // ...Add it // if (TOpenDialog(Sender).Files.Count > 1) then MyList.AddStrings(TOpenDialog(Sender).Files) else MyList.Add(TOpenDialog(Sender).FileName); end;
initialization
MyList := TStringList.Create; // // Note: Duplicates does nothing if the list is not sorted. //MyList.Duplicates := TDuplicates.dupIgnore;
finalization
MyList.Free;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3