循環(huán)微調(diào)控件(CycleSpinner)所實現(xiàn)的功能是:當單擊向上箭頭而達到值時,再單擊向上箭頭,能自動跳到最小值;當單擊向下箭頭而達到最小值時,能自動跳到值;其余功能均繼承Spinner基類的功能。具體實現(xiàn)方法如下:
利用表單控件,在表單中一個微調(diào)按鈕,并設(shè)置如下屬性:
SpinnerHighValue=Max
&&Max應小于Spinner基類所
&&提供的默認值
SpinnerLowValue=Min
&&Min應大于Spinner基類所
&&提供的最小默認值
Value=1
Name=′CycleSpinner′
在Init事件中寫入如下代碼:
This.SpinnerHighValue=This.SpinnerHighValue+This.Increment
This.SpinnerLowValue=This.SpinnerLowValue-This.Increment
在InteractiveChange事件中寫入如下代碼:
If This.Value=This.SpinnerHighValue
This.Value=Int(This.SpinnerLowValue+This.Increment)
Endif
If This.Value=This.SpinnerLowhValue
This.Value=Int(This.SpinnerHighValue-This.Increment)
Endif
Thisform.Refresh
再將其作為類保存起來,添加到你的類庫中。
若你在編程中,需用此功能,就可直接用此循環(huán)微調(diào)控件類了。
利用表單控件,在表單中一個微調(diào)按鈕,并設(shè)置如下屬性:
SpinnerHighValue=Max
&&Max應小于Spinner基類所
&&提供的默認值
SpinnerLowValue=Min
&&Min應大于Spinner基類所
&&提供的最小默認值
Value=1
Name=′CycleSpinner′
在Init事件中寫入如下代碼:
This.SpinnerHighValue=This.SpinnerHighValue+This.Increment
This.SpinnerLowValue=This.SpinnerLowValue-This.Increment
在InteractiveChange事件中寫入如下代碼:
If This.Value=This.SpinnerHighValue
This.Value=Int(This.SpinnerLowValue+This.Increment)
Endif
If This.Value=This.SpinnerLowhValue
This.Value=Int(This.SpinnerHighValue-This.Increment)
Endif
Thisform.Refresh
再將其作為類保存起來,添加到你的類庫中。
若你在編程中,需用此功能,就可直接用此循環(huán)微調(diào)控件類了。