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压缩与解压_不需要特别的控件

Delphi 分割文件合并文件的函数

Delphi nativeexcel获取excel所有列

Delphi real控件 rm格式的播放器

Delphi 防止程序重复执行的单元

Delphi 在 api 函数中使用 pchar 参数的几种方法

Delphi webbrowser的关于流载入流保存和流生成

Delphi中如何控制webbrowser滚动条

Delphi 删除memo某一行

Delphi url 编码的装换

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



打赏

取消

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

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

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

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

评论

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