1
I have a combobox that I read a directory and bring the names of the found files:
exit:
demons.txt
arch.txt
elo.txt
So far so good,
but I would not like the extension to appear in the combobox .txt
, how to remove it?
1
I have a combobox that I read a directory and bring the names of the found files:
exit:
demons.txt
arch.txt
elo.txt
So far so good,
but I would not like the extension to appear in the combobox .txt
, how to remove it?
1
You can use the function TPath.GetFileNameWithoutExtension
:
Uses
IOUtils;
// ....
procedure TForm1.FormCreate(Sender: TObject);
const
Arquivos: array[1..3] of string = ('demons.txt ','arch.txt ','elo.txt');
Var
Arquivo: String;
begin
ComboBox1.Clear;
For Arquivo in Arquivos do
begin
ComboBox1.Items.Add(TPath.GetFileNameWithoutExtension(Arquivo));
end;
end;
Browser other questions tagged delphi delphi-xe8
You are not signed in. Login or sign up in order to post.
if you had for example x files, which can be generated, deleted...
– Guilherme Lima
I fill the combo box with a Tstringlist, how could I pass it as parameter?
– Guilherme Lima
@Guilhermelima Just go through the
StringList
and add to theCombobox
the current item using this function. See: http://pastebin.com/tqvT1B2v– stderr
solved, thank you :D
– Guilherme Lima