I'm trying to edit ShellCtrls.pas
, but I don't have any idea where the part of component is located to create the ListView column.
I need only 1 column to show the name of the file/folder in the ListView without other columns for size, detail, etc.
For now, I just edit the part from TCustomSystmListView.EnumColumns()
, adding this code in the end finally
section:
if Columns.Count > 4 then begin
Column[4].Destroy;
Column[3].Destroy;
Column[2].Destroy;
Column[1].Destroy;
end else
if Columns.Count > 3 then begin
Column[3].Destroy;
Column[2].Destroy;
Column[1].Destroy;
end else
if Columns.Count > 2 then begin
Column[2].Destroy;
Column[1].Destroy;
end else if Columns.Count > 1 then begin
Column[1].Destroy;
end;
It works well for now, but I know that it is not the correct way to do that. I hope someone can tell me how to make this component create only 1 column in the correct way?
PS: any example from Delphi 10.4 or Delphi 7 is okay. I have that component in both versions. I see the code is not far different.
I want the component to only create 1 column by default.
From this screenshot, I just need the column in the green box and don't want the column in the red box.
How to do this from editing code in ShellCtrls.pas
?