[Performance]Set Form's Position
Dim _f As New Form
Private Sub btnSetByPoint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetByPoint.Click
_f.Show()
Dim sw As Stopwatch = Stopwatch.StartNew
For i As Integer = 0 To NumericUpDown1.Value
_f.Location = New Point(10, 10)
Next
sw.Stop()
_f.Hide()
MsgBox("SetByPoint: " & sw.ElapsedMilliseconds.ToString)
End Sub
Private Sub btnSetByProperty_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetByProperty.Click
_f.Show()
Dim sw As Stopwatch = Stopwatch.StartNew
For i As Integer = 0 To NumericUpDown1.Value
_f.Top = 10
_f.Left = 10
Next
sw.Stop()
_f.Hide()
MsgBox("SetByProperty: " & sw.ElapsedMilliseconds.ToString)
End Sub
End Class