看板 Visual_Basic 關於我們 聯絡資訊
自己想出來囉.. 很簡單...只是自己掉進死胡同.. Public Class Form1 Dim count As Integer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick count = count + 1 TextBox1.Text = count End Sub Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then Timer1.Enabled = True End If End Sub Private Sub Button1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseUp Timer1.Enabled = False End Sub End Class ※ 引述《kinggto (靜靜的藍天)》之銘言: : 各位大大好... : 目前新學VB.net,先前對VB6有一定程度的摸索.. : 最近想要寫一個小功能... : 無奈測試了很多次.. : 都是失敗作廠 : 希望大大們可以給小弟一些建議.. : 想法:滑鼠去按一個button 但是試點住不放的情況之下.. : button裡面有一個計數器,會不斷的加上... : 直到滑鼠放開停止.. : 目前有試過用time來控制..失敗 : 用button_mousedown + Windows.Forms.MouseButtons.Left ...失敗 : 希望大大們可以提一些看法與意見.. : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.117.186.138