curtis
21小時前 62c5adb8641e8626a056abc773b72449152d8ae9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
unit DocPrt;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, CheckLst, ExtCtrls, Buttons;
 
type
  TPrintForm = class(TForm)
    Panel1: TPanel;
    DocGB: TGroupBox;
    CheckListBox1: TCheckListBox;
    SelecAllBt: TBitBtn;
    EraseBt: TBitBtn;
    PrtBt: TBitBtn;
    ExitBt: TBitBtn;
    ListBox1: TListBox;
    procedure SelecAllBtClick(Sender: TObject);
    procedure EraseBtClick(Sender: TObject);
    procedure ExitBtClick(Sender: TObject);
    procedure PrtBtClick(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
    procedure CheckListBox1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  PrintForm: TPrintForm;
 
implementation
 
{$R *.dfm}
 
procedure TPrintForm.CheckListBox1Click(Sender: TObject);
begin
  listBox1.ItemIndex := CheckListBox1.ItemIndex;
end;
 
procedure TPrintForm.EraseBtClick(Sender: TObject);
var
  i : Integer;
begin
  for I := 0 to CheckListBox1.Items.Count - 1 do
  begin
    CheckListBox1.Checked[i] := False;
  end;
end;
 
procedure TPrintForm.ExitBtClick(Sender: TObject);
begin
  ModalResult := MrCancel;
end;
 
procedure TPrintForm.FormCreate(Sender: TObject);
begin
  PostMessage(Handle,WM_ACTIVATE,WA_CLICKACTIVE,0);
end;
 
procedure TPrintForm.ListBox1Click(Sender: TObject);
begin
  CheckListBox1.ItemIndex := listBox1.ItemIndex;
end;
 
procedure TPrintForm.PrtBtClick(Sender: TObject);
begin
  ModalResult := MrOk;
end;
 
procedure TPrintForm.SelecAllBtClick(Sender: TObject);
var
  i : Integer;
begin
  for I := 0 to CheckListBox1.Items.Count - 1 do
  begin
    CheckListBox1.Checked[i] := True;
  end;
end;
 
end.