p_which_key.~pas

来自「学员管理的软件」· ~PAS 代码 · 共 99 行

~PAS
99
字号
unit P_which_key;

interface

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

type
  TF_which_key = class(TForm)
    Label1: TLabel;
    ComboBox1: TComboBox;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    procedure FormPaint(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
   private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_which_key: TF_which_key;
  isform:boolean;
  examid:integer;
implementation
uses U_global_setting,main,P_brower_exam;
{$R *.dfm}

procedure TF_which_key.FormPaint(Sender: TObject);
var
w,t,i:integer;
begin
i:=0;
F_which_key.Canvas.Brush.color:=$ffcc88;
while i<F_which_key.ClientWidth do
begin
F_which_key.Canvas.Brush.Color:=F_which_key.Canvas.Brush.Color+$000002;
F_which_key.Canvas.FillRect(REct(i,0,i+5,F_which_key.Clientheight));
i:=i+5;
end;
end;


procedure TF_which_key.SpeedButton2Click(Sender: TObject);
begin
if trim(combobox1.Text)='' then
begin
messagedlg('请核对你所选择的试卷名称',mtinformation,[mbok],0);
exit;
end;
if isform then
begin
examid:=combobox1.ItemIndex;
F_brower_exam.Show;
end
else
shellexecute(handle,'open',pchar('http://localhost/web.asp?id=' + combobox1.text),nil,nil,sw_normal);
close;
end;

procedure TF_which_key.SpeedButton1Click(Sender: TObject);
begin
close;
end;

procedure TF_which_key.FormActivate(Sender: TObject);
var
s:string;
begin
with main.DataModule2 do
begin
  aq1.Close;
  aq1.SQL.Clear;
  aq1.SQL.Add('select * from 试卷表');
  aq1.Open;
  combobox1.Clear;
  try
     aq1.First;
  except
  begin
     messagedlg('对不起,无试卷可以选择预览',mtinformation,[mbok],0);
     exit;
  end;
  end;
  while not aq1.Eof do
  begin
    s:=trim(aq1.FieldValues['试卷名称'])+'['+trim(aq1.FieldValues['出卷人'])+']';
    combobox1.Items.Add(s);
    aq1.Next;
  end;
end;
end;

end.

⌨️ 快捷键说明

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