Foxtable(狐表)用户栏目专家坐堂 → 怎么判断选中的是哪个lbl控件?


  共有1717人关注过本帖平板打印复制链接

主题:怎么判断选中的是哪个lbl控件?

帅哥,在线噢!
xxfoxtable
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1714 积分:16053 威望:0 精华:0 注册:2017/6/1 23:12:00
怎么判断选中的是哪个lbl控件?  发帖心情 Post By:2023/10/8 20:31:00 [只看该作者]

Dim pb As WinForm.Panel = Forms("菜单").Controls("Panel1")
Dim width As Integer = pb.width
Dim height As Integer = pb.height
Dim wh As Integer = width \ 105

Dim n As Integer = Tables("桌台信息").Rows.Count

Dim lbl As WinForm.panel
Dim lbl1 As WinForm.Label
Dim p As WinForm.PictureBox
Dim s, t As Integer


For i As Integer = 0 To n - 1
    If i <> 0 Then
        If i Mod wh = 0 Then
            s = 0
            t = t + lbl.Height + 10
        Else
            s = s +115
        End If
    End If
    
    Dim r As Row = Tables("桌台信息").Rows(i)
    Dim nm As String = r("序号")
    Dim nm0 As String = r("桌台号")

    
    lbl = Forms("菜单").CreateControl(nm, ControlTypeEnum.Panel)
    lbl.name = nm
    lbl.BackColor = Color.lightgray
    lbl.Left = s
    lbl.Top = t
    lbl.Width = 105
    lbl.Height = 90
    Forms("菜单").Controls("panel1").AddControl(lbl)
    
    lbl1 = Forms("菜单").CreateControl(nm0, ControlTypeEnum.Label)
    lbl1.BackColor = Color.green
    lbl1.ForeColor = Color.White
    lbl1.Left = 0
    lbl1.Top = 0
    lbl1.Width = 105
    lbl1.Height = 20
    lbl1.Text = space(4) & nm0
    lbl.AddControl(lbl1)
    
    p = Forms("菜单").CreateControl(nm0, ControlTypeEnum.PictureBox)
    p.name = nm0
    p.Left = s
    p.Top = t + 20
    p.Width = 105
    p.Height = 70
    Forms("菜单").Controls("panel1").AddControl(p)

 回到顶部
总数 29 1 2 3 下一页