 |
|
|
 |
 |
|
Code (VB.NET)
Me.textBox1 = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
' textBox1
'
Me.textBox1.AcceptsReturn = True
Me.textBox1.AcceptsTab = True
Me.textBox1.Dock = System.Windows.Forms.DockStyle.Fill
Me.textBox1.Multiline = True
Me.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
'
' Form1
'
Me.ClientSize = New System.Drawing.Size(284, 264)
Me.Controls.Add(Me.textBox1)
Me.textBox2 = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
' textBox2
'
Me.textBox2.AcceptsReturn = True
Me.textBox2.AcceptsTab = True
Me.textBox2.Dock = System.Windows.Forms.DockStyle.Fill
Me.textBox2.Multiline = True
Me.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
'
' Form1
'
Me.ClientSize = New System.Drawing.Size(284, 264)
Me.Controls.Add(Me.textBox2)
ใส่ Loop เอาครับ
|
 |
 |
 |
 |
Date :
2011-09-05 15:23:53 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
For i As Integer = 0 To 10
Dim tb As New TextBox()
tb.Location = New System.Drawing.Point(40, 120 + i * 20)
tb.Name = "TextBoxName" & i.ToString()
tb.Size = New System.Drawing.Size(184, 20)
tb.TabIndex = i + 2
tb.Text = [String].Empty
Me.Controls.Add(tb)
Next
|
 |
 |
 |
 |
Date :
2011-09-05 15:28:26 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Private textboxes As ArrayList
Private Tboxes As Integer = 3
Private Sub Method2()
Dim i As Integer = 0
Me.textboxes = New ArrayList()
For i = 0 To Tboxes - 1
Me.textboxes.Add(New TextBox())
DirectCast(Me.textboxes(i), TextBox).Location = New System.Drawing.Point(40, 36 + i * 20)
DirectCast(Me.textboxes(i), TextBox).Name = "TextBoxName" & i.ToString()
DirectCast(Me.textboxes(i), TextBox).Size = New System.Drawing.Size(184, 20)
DirectCast(Me.textboxes(i), TextBox).TabIndex = i + 2
DirectCast(Me.textboxes(i), TextBox).Text = [String].Empty
Me.Controls.Add(DirectCast(Me.textboxes(i), TextBox))
Next
End Sub
|
 |
 |
 |
 |
Date :
2011-09-05 15:29:39 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณ mr.win มากคะ
เดี๋ยวจะลองเอาไปใช้คะ
|
ประวัติการแก้ไข 2011-09-05 15:48:57
 |
 |
 |
 |
Date :
2011-09-05 15:47:47 |
By :
honey |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|