Delphi 怎样判断SpinEdit在微调时值是增加还是减少了


本文整理自网络,侵删。

 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Spin;

type
TForm1 = class(TForm)
SpinEdit1: TSpinEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure DownClick(Sender: TObject);
procedure UpClick(Sender: TObject);
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.DownClick(Sender: TObject);
begin
SpinEdit1.Text:= IntToStr(StrToInt(SpinEdit1.Text) - 1);
ShowMessage('按下了减小按钮!');
end;

procedure TForm1.UpClick(Sender: TObject);
begin
SpinEdit1.Text:= IntToStr(StrToInt(SpinEdit1.Text) + 1);
ShowMessage('按下了增大按钮!');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
SpinEdit1.Button.OnDownClick:= DownClick;
SpinEdit1.Button.OnUpClick:= UpClick;
end;

end.

相关阅读 >>

Delphi 官方提供的六十多个firedac例子

Delphi里面判断一个字符串在另一个字符串中出现的次数

Delphi分离汉字和英文字母

Delphi用邻域平均法对图像进行平滑处理

Delphi fdconnection执行sql execsql

delph做的百叶窗小程序

Delphi webservices传base64字串

Delphi 取整算法集合

Delphi控件adsl拨号和断开

Delphi下pos机控制钱箱,客显,打印机

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...