을 heres는 내가 그것을 어떻게 ... 첫 번째 드롭 형태의 콤보, dbmemo와 (당신이 이미 가지고) 목록 상자를 체크에 세 가지 구성 요소.
다음 단위 'VAR'에 문자열 목록 변수를 추가 섹션 내가 'TStringList를 항목 분명 콤보 상자를 초기화하고'카테고리 1 '을 추가하고이 formcreate 이벤트에
strs : tstringlist;
다음 을 strs 명명하고
,691,363 : 구분 2 '항목은 .....를 heres는 다음
procedure TForm2.FormCreate(Sender: TObject);
begin
strs := TStringList.create;
strs.Add('food');
strs.Add('magazine');
strs.Add('pencil');
strs.Add('newspaper');
Combobox1.Items.clear;
ComboBox1.Items.add('category1');
ComboBox1.Items.add('category2');
end;
우리가 콤보 상자 변경에 대한 이벤트 핸들러를 작성하고 checklistbox 및 dbmemo를 업데이트하는 코드를 작성하는 방법 (210)
procedure TForm2.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.ItemIndex = 0 then
DBMemo1.lines.AddStrings(strs);
CheckListBox1.Items.addstrings(strs);
end;
을 heres 전체 코드 : 무언가가 당신에게 불분명하거나, 병이 시도는 더 세부 사항을 설명하기 위해 뭔가를 이해 해달라고하면
unit project1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DBCtrls, CheckLst;
type
TForm2 = class(TForm)
ComboBox1: TComboBox;
DBMemo1: TDBMemo;
CheckListBox1: TCheckListBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
strs : tstringlist;
implementation
{$R *.dfm}
procedure TForm2.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.ItemIndex = 0 then
DBMemo1.lines.AddStrings(strs);
CheckListBox1.Items.addstrings(strs);
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
strs := TStringList.create;
strs.Add('food');
strs.add('magazine');
strs.Add('pencil');
strs.add('newspaper');
combobox1.Items.clear;
ComboBox1.items.add('category1');
ComboBox1.items.add('category2');
end;
end.
난이 도움을 바랍니다, 문의하시기 바랍니다.
잘 찾아 냈습니다. 누락 된 "From Table where x ="부분을 바로 읽으십시오. –