Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
For i As Integer = 0 To 9
Me.BeginInvoke(Sub(cnt)
Dim b = New Button()
b.Text = cnt.ToString()
b.Top = b.Height * cnt
Me.Controls.Add(b)
End Sub,
New Object() {i})
Next
End Sub
End Class
UHVibGljIENsYXNzIEZvcm0xCgogICAgUHJpdmF0ZSBTdWIgRm9ybTFfTG9hZChzZW5kZXIgQXMgU3lzdGVtLk9iamVjdCwgZSBBcyBTeXN0ZW0uRXZlbnRBcmdzKSBIYW5kbGVzIE15QmFzZS5Mb2FkCiAgICAgICAgTWUuQmFja2dyb3VuZFdvcmtlcjEuUnVuV29ya2VyQXN5bmMoKQogICAgRW5kIFN1YgoKICAgIFByaXZhdGUgU3ViIEJhY2tncm91bmRXb3JrZXIxX0RvV29yayhzZW5kZXIgQXMgU3lzdGVtLk9iamVjdCwgZSBBcyBTeXN0ZW0uQ29tcG9uZW50TW9kZWwuRG9Xb3JrRXZlbnRBcmdzKSBIYW5kbGVzIEJhY2tncm91bmRXb3JrZXIxLkRvV29yawoKICAgICAgICBGb3IgaSBBcyBJbnRlZ2VyID0gMCBUbyA5CiAgICAgICAgICAgIE1lLkJlZ2luSW52b2tlKFN1YihjbnQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaW0gYiA9IE5ldyBCdXR0b24oKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYi5UZXh0ID0gY250LlRvU3RyaW5nKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIuVG9wID0gYi5IZWlnaHQgKiBjbnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lLkNvbnRyb2xzLkFkZChiKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgRW5kIFN1YiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgTmV3IE9iamVjdCgpIHtpfSkKICAgICAgICBOZXh0CiAgICBFbmQgU3ViCkVuZCBDbGFzcw==