【delphi开源代码栏目提醒】:网学会员delphi开源代码为您提供u_add_custom.pas参考,解决您在u_add_custom.pas学习中工作中的难题,参考学习。
unit u_add_custom;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ExtDlgs;
type
TF_add_custom = class(TForm)
Label1: TLabel;
Label2: TLabel;
i_id_type: TListBox;
Label3: TLabel;
i_sex: TRadioGroup;
i_name: TEdit;
i_id_copy: TImage;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
i_from: TEdit;
i_id: TEdit;
i_addr: TMemo;
i_remark: TMemo;
B_add: TButton;
OpenPictureDialog1: TOpenPictureDialog;
procedure i_idChange(Sender: TObject);
procedure i_id_copyDblClick(Sender: TObject);
procedure B_addClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
procedure SetID(ID:String);
end;
var
F_add_custom: TF_add_custom;
implementation
uses u_data;
{$R *.DFM}
procedure TF_add_custom.SetID(ID:String);
begin
i_id.Text:=ID;
end;
procedure TF_add_custom.i_idChange(Sender: TObject);
begin
if not B_add.Enabled then B_add.Enabled:=True;
end;
procedure TF_add_custom.i_id_copyDblClick(Sender: TObject);
begin
if OpenPictureDialog1.Execute then
i_id_copy.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end;
procedure TF_add_custom.B_addClick(Sender: TObject);
var
IDType,Sex:String;
begin
IDType:=IntToStr(i_id_type.ItemIndex);
if i_sex.ItemIndex=0 then
Sex:='M'
else
Sex:='F';
DM_main.AddCustom(i_id.Text, IDType, i_name.Text, Sex,
i_from.Text, i_addr.Text, i_remark.Text, OpenPictureDialog1.FileName);
end;
procedure TF_add_custom.FormShow(Sender: TObject);
begin
DM_main.GetIDType(i_id_type.Items);
i_id_type.ItemIndex:=0;
end;
end.
上一篇:
U_ADD.PAS
下一篇:
10years匿名社交网