鱼C论坛

 找回密码
 立即注册
查看: 2769|回复: 2

[分享] 第一天学习DELPHI 交作业 跟着视频写了个苍井空计算器哈!

[复制链接]
发表于 2012-12-27 07:39:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 命苦不能怪ZF 于 2012-12-27 07:50 编辑
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, mmsystem, ExtCtrls; 

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Label3: TLabel;
Image1: TImage;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit7: TEdit;
Button6: TButton;
Button5: TButton;
Edit6: TEdit;
Edit8: TEdit;
procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;
procedure Edit1Click(Sender: TObject);
procedure Edit2Click(Sender: TObject);
procedure Edit3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button5Click(Sender: TObject);


private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure Tform1.WMNCHitTest(var M: TWMNCHitTest);
begin
inherited; { call the inherited message handler }
if M.Result = htClient then { is the click in the client area? }
M.Result := htCaption; { if so, make Windows think it's }
{ on the caption bar. }
end;





procedure TForm1.Edit1Click(Sender: TObject);
begin
Edit1.Text:='';


end;

procedure TForm1.Edit2Click(Sender: TObject);
begin
Edit2.Text:='';
end;

procedure TForm1.Edit3Click(Sender: TObject);
begin
Edit3.Text:='';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Label4.Caption:='+';
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)+ StrToFloat(Edit2.Text) );
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Label4.Caption:='-';
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)- StrToFloat(Edit2.Text));
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Label4.Caption:='×';
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text));
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Label4.Caption:='÷';
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)/ StrToFloat(Edit2.Text));
end;



procedure TForm1.Button6Click(Sender: TObject);
begin
Close
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
{ Edit6.Text:=((Edit4.Text) + (Edit5.Text) + (Edit7.Text)) ; }
MCISendString('OPEN C:\WINDOWS\Media\flourish.mid TYPE SEQUENCER ALIAS NN', '', 0, 0);
MCISendString('PLAY NN FROM 0', '', 0, 0);
MCISendString('CLOSE ANIMATION', '', 0, 0);
ShowMessage( (Edit8.Text)+(Edit4.Text) + (Edit5.Text) + (Edit7.Text));
end;

end.
我了个不能上传图片新人啊悲催


                               
登录/注册后可看大图


Project1.rar (227.43 KB, 下载次数: 16)

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2012-12-27 11:29:37 | 显示全部楼层
不错。。。。继续努力
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2014-8-26 19:46:24 | 显示全部楼层
学习学习
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-12-22 14:56

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表