DELPHI XE5 Form ShowModal 공식 예제

2607 단어 Delphi
Calling ShowModal as an Anonymous Method on All Platforms


procedure THeaderFooterForm.btnPickClick(Sender: TObject); var dlg: TForm1; begin dlg := TForm1.Create(nil); // select current value, if available in the list dlg.ListBox1.ItemIndex := dlg.ListBox1.Items.IndexOf(edit1.Text);   dlg.ShowModal(procedure(ModalResult: TModalResult) begin if ModalResult = mrOK then // if OK was pressed and an item is selected, pick it if dlg.ListBox1.ItemIndex >= 0 then edit1.Text := dlg.ListBox1.Items [dlg.ListBox1.ItemIndex]; dlg.DisposeOf; end);   end;

좋은 웹페이지 즐겨찾기