掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ComboBoxで重複した文字の消し方は? (ID:19109)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
StringGridのCellからComboBoxに入れて同じ項目は消したいんですけどどうしたらいいんですか? procedure TForm1.Button1Click(Sender: TObject); var F : TextFile; Str : String; RowCNT : Integer; begin if not OpenDialog1.Execute then exit; AssignFile(F,OpenDialog1.FileName); ReSet(F); RowCNT := 0; try While not EOF(F) do begin Readln(F,Str); Str := StringReplace(Str,',' , '","' ,[rfReplaceAll]); Str := '"'+ Str +'"'; Str := StringReplace(Str, '""','" "', [rfReplaceAll]); StringGrid1.Rows[RowCNT].CommaText:= Str; if RowCNT<>0 then if StringGrid1.Cells[8,RowCNT]<>' ' then ComboBox1.Items.Append(StringGrid1.Cells[8,RowCNT]); Inc(RowCNT); end; finally CloseFile(F); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.