Private Sub Command1_Click(Index As Integer) For i = 1 To Image3.Count
If Image3.Count > 1 Then
Unload Image3(i)
Unload Label3(i)
End If
Next i
For i = 1 To Index
Command1(i).Top = Command1(0).Top + Command1(0).Height * (i)
Next i
For i = Index + 1 To Command1.Count - 1
Frame1.Top = Command1(Index).Top + Command1(0).Height
Command1(i).Top = Frame1.Top + Frame1.Height + Command1(0).Height * (i - Index)
Next i
For i = 1 To Command1(Index).Tag
Load Image3(i)
Load Label3(i)
Image3(i).Picture = LoadPicture(App.Path & "\" & Index & i & ".bmp")
Image3(i).Top = 900 * i - 500
Image3(i).Left = 800
Label3(i).Top = Image3(i).Top + 650
Label3(i).Left = Image3(i).Left - 100
Image3(i).Visible = True
Label3(i).Visible = True
Next i
Select Case Index
Case 0
Label3(1).Caption = "文学类图书"
Label3(2).Caption = "计算机类图书"
Case 1
Label3(1).Caption = "第一位遗漏"
Label3(2).Caption = "第二位遗漏"
Label3(3).Caption = "第三位遗漏"
Case 2
Label3(1).Caption = "同学录"
Label3(2).Caption = "校友录"
Case 3
Label3(1).Caption = "省内企业"
Label3(2).Caption = "省外企业"
Case 4
Label3(1).Caption = "员工通讯录"
Label3(2).Caption = "员工档案"
Label3(3).Caption = "员工业绩管理"
End Select
End SubPrivate Sub Label1_Click(Index As Integer)
Dim mx As String
Select Case Index
Case 0
mx = &HFFC0C0
Case 1
mx = &HFF00&
Case 2
mx = &HFF&
Case 3
mx = &HFFFF&
End Select
For i = 0 To Command1.Count - 1
Command1(i).BackColor = mx
Next i
End SubPrivate Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
Image2.Visible = False
Image4.Visible = False
Image5.Visible = False
If Index = 0 Then
Image1.Visible = True
End If
If Index = 1 Then
Image2.Visible = True
End If
If Index = 2 Then
Image4.Visible = True
If Image3.Count > 1 Then
Unload Image3(i)
Unload Label3(i)
End If
Next i
For i = 1 To Index
Command1(i).Top = Command1(0).Top + Command1(0).Height * (i)
Next i
For i = Index + 1 To Command1.Count - 1
Frame1.Top = Command1(Index).Top + Command1(0).Height
Command1(i).Top = Frame1.Top + Frame1.Height + Command1(0).Height * (i - Index)
Next i
For i = 1 To Command1(Index).Tag
Load Image3(i)
Load Label3(i)
Image3(i).Picture = LoadPicture(App.Path & "\" & Index & i & ".bmp")
Image3(i).Top = 900 * i - 500
Image3(i).Left = 800
Label3(i).Top = Image3(i).Top + 650
Label3(i).Left = Image3(i).Left - 100
Image3(i).Visible = True
Label3(i).Visible = True
Next i
Select Case Index
Case 0
Label3(1).Caption = "文学类图书"
Label3(2).Caption = "计算机类图书"
Case 1
Label3(1).Caption = "第一位遗漏"
Label3(2).Caption = "第二位遗漏"
Label3(3).Caption = "第三位遗漏"
Case 2
Label3(1).Caption = "同学录"
Label3(2).Caption = "校友录"
Case 3
Label3(1).Caption = "省内企业"
Label3(2).Caption = "省外企业"
Case 4
Label3(1).Caption = "员工通讯录"
Label3(2).Caption = "员工档案"
Label3(3).Caption = "员工业绩管理"
End Select
End SubPrivate Sub Label1_Click(Index As Integer)
Dim mx As String
Select Case Index
Case 0
mx = &HFFC0C0
Case 1
mx = &HFF00&
Case 2
mx = &HFF&
Case 3
mx = &HFFFF&
End Select
For i = 0 To Command1.Count - 1
Command1(i).BackColor = mx
Next i
End SubPrivate Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
Image2.Visible = False
Image4.Visible = False
Image5.Visible = False
If Index = 0 Then
Image1.Visible = True
End If
If Index = 1 Then
Image2.Visible = True
End If
If Index = 2 Then
Image4.Visible = True
Dim btn(9) As Button '建立一个控件数组
btn(1) = Button1
btn(2) = Button2
btn(3) = Button3
Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox("第" & CType(sender, Button).TabIndex & "个控件:" & CType(sender, Button).Text)
End Sub
你还要给每个按钮指定这个单击事件
vb2010 里面能把 button 与 radiobutton 控件结合,用数组控件制作 导航菜单吗?
我想用vb2010 开发数据库,很重要的是对表格数据的统计分析,能用QQ向你请教吗?我的QQ 26334980(请注明vb),谢谢!