在我的應用程序中,我得到了幾個定時器,timer1也是timer5。 timer1激活timer2等,將前一個定時器設置爲false。vb6檢查是否有多個定時器
,所以我想使後面這些其他定時器,像「TIMER6」
if timer1.enabled = true then 'then it should check if the timer2 now is enabled
if timer2.enabled = true then 'and so on to it reaches timer5..
需要任何例子來實現這一點,因爲我在一個停止點,基本上只需要這部分工作。
我的想法只是要做到這一點在TIMER6
if timer1.enabled = true then
if timer2.enabled = true then
if etc etc
else
timer6.enabled = true
timer6.enabled = false
end if
end if
end if
末次
任何想法如何做到這一點?
所以..我正在尋找一種方法來檢查所有定時器在一種情況下啓用,並禁用最後一個。
這是措辭不當,請不要解釋它是一半的代碼和一半的邏輯,而是完全解釋邏輯,然後發佈你自己試着寫的代碼。 –
你有沒有考慮過使用控制陣列?然後您將擁有所有具有相同名稱的定時器,但使用Index屬性將它們分開。然後你可以通過索引遍歷集合。 – GTG