vb 2005 BUTTON問題???

2006-11-29 8:58 pm
Private Sub btna_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btna.Click
btna.Text = "STOP"
If HScrollBar1.Minimum > 0.1 Then
Timer1.Enabled = True
End If
End Sub
但我想問我一按button時,佢會變stop,但在安一次會變start,同個time1會變flase點set.....

回答 (2)

2006-11-29 9:05 pm
✔ 最佳答案
Private Sub btna_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btna.Click
If HScrollBar1.Minimum > 0.1 Then
Timer1.Enabled = Not Timer1.Enabled
If Timer1.Enabled Then
btna.Text = "STOP"
Else
btna.Text = "START"
End IF
End If
End Sub

PS. 我有幾年冇寫VB.Net 了 (因為現職 Java Programmer)
參考: 我
2006-11-29 9:09 pm
Private Sub btna_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btna.Click

if(btna.Text = "START")
Then btna.Text = "STOP"
Time1.Enable = True
Else btna.Text = "START"
Timer1.Enabled = False
End If
End Sub


收錄日期: 2021-04-25 13:01:52
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061129000051KK01244

檢視 Wayback Machine 備份