Dim controlname As String
If TypeOf e.sender Is WinForm.Panel Then
controlname = e.sender.name
ElseIf e.sender.parent IsNot Nothing Then
If TypeOf e.sender.Parent Is WinForm.Panel Then
controlname = e.sender.parent.name
End If
End If
Vars("序号") = controlname
Dim l As Integer = Tables("桌台信息").Rows.Count
For i As Integer = 0 To l - 1
Dim r As Row = Tables("桌台信息").Rows(i)
Forms("菜单").Controls(r("序号")).BorderStyle = BorderStyle.None
Forms("菜单").Controls(r("序号")).BackColor = Color.Lightgray
Next
If TypeOf e.sender Is WinForm.PictureBox Then
Dim tt As system.windows.forms.panel = Forms("菜单").Controls(controlname).basecontrol
AddHandler tt.paint, AddressOf panel_paint
tt.refresh
End If
把panel设置大一点了,但以前选过的边柜不消失 Forms("菜单").Controls(r("序号")).BorderStyle = BorderStyle.None Forms("菜单").Controls(r("序号")).BackColor = Color.Lightgray 这个语句不管用吗? |