Private number As Integer Private rows As Integer Private columns As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim form2 As New Form() ' Create a button to add to the new form. Dim button1 As New Button() ' Set text for the button. button1.Text = "Scrolled Button" ' Set the size of the button. button1.Size = New Size(1000, 800) ' Set the location of the button to be outside the form's client area. button1.Location = New Point(form2.Size.Width + 200, form2.Size.Height + 200) ' Add the button control to the new form. form2.Controls.Add(button1) ' Set the AutoScroll property to true to provide scrollbars. form2.AutoScroll = True ' Display the new form as a dialog box. form2.ShowDialog() If Not Integer.TryParse(TextBox1.Text, rows) OrElse _ Not Integer.TryParse(TextBox2.Text, columns) OrElse _ Not Integer.TryParse(TextBox3.Text, number) Then MessageBox.Show("数字で入力してください", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Sub End If Me.Bounds = New Rectangle(10, 10, 1300, 900) Dim cnt As Integer = 0 For k As Integer = 1 To number For i As Integer = 1 To rows For j As Integer = 1 To columns Dim tb As TextBox = New TextBox() cnt += 1 tb.Name = "tb" + cnt.ToString() Me.Controls.Add(tb) tb.Top = (i - 1) * 30 + 80 tb.Left = (j - 1) * 60 + 70 * (columns * (k - 1)) + 10 tb.Width = 50 Next Next Next End Sub スクロール画面を作成し、 そのスクロール画面上にボタンを1つ作り、 テキストボックスが出てくるようにしたいです。 どうすればできるのでしょうか 。 これはわかるところまで作成しています。
↧