delphi.gif (306 バイト) SpinButtonの使い方


SamplesといってもDelphiのサンプルはあなどれません。実用性は十分です。

Samplesタブにあるコンポーネントはヘルプがありません。その代わりソースが\Delphi3\Source\Samplesにあります。


SpinButtonはUpDownコントロールと似ていますが、ボタンのグラフィックを変更できます。

 

toach.gif (917 バイト) ボタンが押されたときのハンドラを追加するには

OnDownClick、OnUpClickイベントに応答するハンドラを追加すると、それぞれのボタンが押されたときの動作を決めることができます。

procedure TForm1.SpinButton1DownClick(Sender: TObject);
begin
  Gauge1.Progress := Gauge1.Progress - 1;
end;

procedure TForm1.SpinButton1UpClick(Sender: TObject);
begin
  Gauge1.Progress := Gauge1.Progress + 1;
end;