Click事件
Select Case e.Sender.Name
Case "Label1","Label2","Label3","Label4"
Dim top As Integer = 3
For i As Integer = 1 To 4
Dim Lbl As WinForm.Label = e.Form.Controls("Label" & i)
Dim Pnl = e.Form.Controls("Panel" & i)
If i = e.sender.name.Replace("Label", "") Then
Pnl.Visible = Not Pnl.Visible
e.sender.BaseControl.Image = IIf(Pnl.Visible, GetImage("control-270.png"),GetImage("control.png"))
e.sender.BackColor = IIf(Pnl.Visible, Drawing.SystemColors.ControlDark, Drawing.SystemColors.Control)
Else
Pnl.Visible = False
End If
lbl.Top = Top
Top += lbl.Height + 3
If pnl.visible Then
Pnl.Top = Top
Top += pnl.height + 3
End If
Next
End Select