本篇文章的主要開發環境是Visual Studio
打開 Visual Studio
窗體應用技巧一
創建新工程後
進入代碼編輯器
Public Class Form
Inherits System
Private Sub Form
Dim pos As Point = New Point(
Me
Timer
Timer
Timer
Timer
End Sub
進入Timer
Private Sub Timer
Dim pos As Point = New Point(Me
If pos
Me
Else
Timer
Timer
End If
End Sub
進入Timer
Private Sub Timer
Dim pos As Point = New Point(Me
If pos
Me
Else
Timer
Timer
End If
End Sub
創建完成後我們來運行程序測試一下
窗體應用技巧二
創建新工程後
相關的屬性設置如下
TrackBar
TickFrequency: 屬性:
Maximum屬性:
Label
Timer
進入代碼編輯器
首先進行聲明
Public Class Form
Inherits System
Dim tps As Integer
Dim bol As Boolean
進入TrackBar
Private Sub TrackBar
Me
Label
End Sub
進入Timer
Private Sub Timer
If bol = False Then
tps = tps +
Me
If Me
Timer
bol = True
End If
Else
tps = tps
Me
If Me
Timer
bol = False
End If
End If
End Sub
進入Form
Private Sub Form
Timer
End Sub
進入Form
Private Sub Form
Timer
If MsgBox(
e
Else
Timer
Me
tps =
bol = True
e
End If
End Sub
創建完成後我們來運行程序測試一下
From:http://tw.wingwit.com/Article/program/net/201311/11580.html