dhqkcx_form.pas

来自「一个仓库管理中的子系统--采购子系统」· PAS 代码 · 共 87 行

PAS
87
字号
unit dhqkcx_form;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ExtCtrls;

type
  Tdhqk_Form = class(TForm)
    Bevel1: TBevel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    ComboBox2: TComboBox;
    Label1: TLabel;
    RD1: TRadioGroup;
    ComboBox1: TComboBox;
    ComboBox3: TComboBox;
    procedure FormActivate(Sender: TObject);
    procedure RD1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  dhqk_Form: Tdhqk_Form;

implementation

uses Datamodule;

{$R *.DFM}

procedure Tdhqk_Form.FormActivate(Sender: TObject);
begin
    with datamodule1.query3 do
    begin
       sql.clear;
       sql.add(' Select distinct qt from dbo.a_cghzglb');
       prepare;
       open;
       first;
       combobox1.Items.Clear;
       while  not eof do
       begin
         if fieldbyname('qt').asstring<>'' then
         combobox1.Items.Add(fieldbyname('qt').asstring);
         next;
       end;
       close;
    end;
    with datamodule1.query3 do
    begin
       sql.clear;
       sql.add(' Select distinct YCDHSJ from dbo.a_cghzglb');
       prepare;
       open;
       first;
       combobox3.Items.Clear;
       while  not eof do
       begin
         if fieldbyname('YCDHSJ').asstring<>'' then
         combobox3.Items.Add(fieldbyname('YCDHSJ').asstring);
         next;
       end;
       close;
    end;
end;

procedure Tdhqk_Form.RD1Click(Sender: TObject);
begin
   if RD1.ItemIndex=0 then
   begin
   combobox3.Enabled:=true;
   combobox1.Enabled:=false;
   end
   else
   begin
   combobox3.Enabled:=false;
   combobox1.Enabled:=true;
   end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?