Delphi 동적 생성 창, 잠금 창 값

1250 단어 Delphi
 Var



    TempForm: array of TForm2;



procedure TForm1.Button2Click(Sender: TObject);

Var

  i:Integer;

  bNew:Boolean;

begin

 bNew:=True;

  For i:=Low(TempForm) to High(TempForm) do

    begin

       IF TempForm[i].Caption=Trim(Edit1.Text) then

          begin

             TempForm[i].Show;

             bNew:=False;

             Exit;

           end;

           bNew:=True;

      end;

    IF bNew then

      begin

        SetLength(TempForm,Length(TempForm)+1);  //        

        TempForm[High(TempForm)]:=TForm2.Create(nil); //    

        TempForm[High(TempForm)].Caption:=Trim(Edit1.Text); //  Caption   ,    

        Self.CheckListBox1.Items.Add(Trim(Edit1.Text));

        TempForm[High(TempForm)].Show;     //                

       end;

end;



procedure TForm1.Button3Click(Sender: TObject);

Var

 i:integer;

 bName:String;

begin

  For I:=0 to CheckListBox1.Count-1 do

    begin

       if CheckListBox1.Selected[i] then

          bName:=CheckListBox1.Items.Strings[i];

     end;

  For I:=Low(TempForm) to high(TempForm) do

    begin

      if TempForm[i].Caption=bName then

        begin

           TempForm[i].Edit1.text:=Edit2.text;

         end;

      end;

end;


좋은 웹페이지 즐겨찾기