问题描述
如何将整数数组的成员显示到已在Visual Basic 2008中分组在一起的文本框中?
在此先感谢
我是说
公开组1作为新列表(控制权)
公开Sub Assign()
group1.Add(Me.textbox1)
group1.Add(Me.textbox2)
group1.Add(Me.textbox3)
group1.Add(Me.textbox4)
group1.Add(Me.textbox5)
group1.Add(Me.textbox6)
group1.Add(Me.textbox7) group1.Add(Me.textbox8)
group1.Add(Me.textbox9)
group1.Add(Me.textbox10)
Dim i As Integer
昏暗的arraylist(7)作为整数
arraylist(0)= 1
arraylist(1)= 2
arraylist(2)= 3
arraylist(3)= 4
arraylist(4)= 5
arraylist(5)= 6
arraylist(6)= 7
arraylist(7)= 8
对于i = 0到UBound(subject)
对于每个A in mon1
如果TypeOf A是TextBox,则
A.Text = A.Text& arraylist(i).ToString& vbCrLf
如果结束
下一个(A)
下一个
结束子
Public Sub Button1_Click(ByVal发送者为System.Object,ByVal e为System.EventArgs)处理Button1.Click
调用assign()
结束子
问题是我无法弄清楚如何确保组中的每个文本框都不会显示相同的数字..
请提供关于改进或更好的替代方法的建议. as 整数 dim arr( 5 ) as 整数 for 的I = 0 to ubound(arr ) textbox1.text = textbox1.text& arr(I).tostring& vbcrlf下一个
how can one display the members of an array of integers into textboxes that have been grouped together in visual basic 2008
thanks in advance
I mean
Public group1 As New List(Of Control)
Public Sub assign()
group1.Add(Me.textbox1)
group1.Add(Me.textbox2)
group1.Add(Me.textbox3)
group1.Add(Me.textbox4)
group1.Add(Me.textbox5)
group1.Add(Me.textbox6)
group1.Add(Me.textbox7)
group1.Add(Me.textbox8)
group1.Add(Me.textbox9)
group1.Add(Me.textbox10)
Dim i As Integer
Dim arraylist(7) As Integer
arraylist(0) = 1
arraylist(1) = 2
arraylist(2) = 3
arraylist(3) = 4
arraylist(4) = 5
arraylist(5) = 6
arraylist(6) = 7
arraylist(7) = 8
For i = 0 To UBound(subject)
For Each A In mon1
If TypeOf A Is TextBox Then
A.Text = A.Text & arraylist(i).ToString & vbCrLf
End If
Next (A)
Next
end sub
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call assign()
End Sub
the problem is that I cannot figure out how to make sure each textbox in the group does not display the same number..
kindly advice on the way foward or better altenative
这篇关于使用Visual Basic 2008将整数数组显示到分组的文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!