vb.net控件组合 vb 控件组( 三 )


RadioButton TabIndex =
RadioButton Text = 一单元
RadioButton
RadioButton BackColor = System Drawing SystemColors Control
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 四单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 二楼
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 三楼
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 一楼
RadioButton
RadioButton BackColor = System Drawing SystemColors Control
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 四楼
分别把它们添加到父控件GroupBox的Controls集合中
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
End Sub
把上一页的代码复制添加后 把控件初始化过程InitializeControl()过程添加到Form 的New构造函数中 如下图二所示
图二 在New构造函数中添加过程InitializeControl()
现在按F 运行 Form 的窗体控件布局(如下图三所示)是不是和我们手工布局的图一的布局是一样的呢?
lishixinzhi/Article/program/ASP/201311/21749
vb.net 控件集合Private Sub b_click(sender As Object, e As EventArgs)
MsgBox(sender.name)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim b() As Button = {Button1, Button2, Button3}
For Each i In b
AddHandler i.Click, AddressOf b_click
Next
End Sub
vb.net 排列组合 代码第一题:
不需要任何控件,代码如下:
【vb.net控件组合 vb 控件组】Private Sub Form_Click()
Dim A() As Integer, N As Integer
Dim St As String, I As Integer, J As Integer
Randomize
Do
St = InputBox("数字vb.net控件组合的个数", "输入", Int(Rnd * 100))
If St = "" Then
MsgBox "请输入数字!"
Else
N = Int(Val(St))
If N1 Then
MsgBox "请输入大于0的数字!"
Else
Exit Do
End If
End If
Loop
ReDim A(N)
For I = 1 To N
Do
St = InputBox("第" + Str(I) + "个数字", "输入", Int(Rnd * 100))
If St = "" Then
MsgBox "请输入数字!"
Else
A(I) = Int(Val(St))
Exit Do
End If
Loop
Next
For I = 1 To N - 1
For J = I + 1 To N
If A(I)A(J) Then
A(0) = A(I)
A(I) = A(J)
A(J) = A(0)
End If
Next
Next
For I = 1 To N
Open App.Path"\"Trim(Str(I))".txt" For Output As #1
Print #1, A(I)
Close #1
Next
Print "已经把"; N; "个数写入到"; App.Path; "\1.txt 到 "; N; ".txt中.请查看."
End Sub
'已经运行过.
第二题:
DIM 是变量声明语句,它的格式为:

推荐阅读