Dim B2 As WinForm.Button = e.Form.Controls("Button2") B2.ToolTip = "提示内容2" Dim xm As String = DataTables("项目").DataRows(0)("项目") Dim gx As String Dim drs As List (of DataRow) = DataTables("工序").Select("项目 = '" & xm & "'" ,"工序") Dim x,y,i As Integer '定义控件的位移大小 x = 0 y = 0 i = 1 Dim lbl As WinForm.Label For Each dr As DataRow In drs lbl = e.Form.CreateControl("lable" & i, ControlTypeEnum.Label) lbl. BorderStyle = BorderStyle.FixedSingle lbl.TextAlign = ContentAlignment.middlecenter lbl.AutoSize = True lbl.Text = dr("工序") lbl.Left = 100 + x lbl.Top = 100 If dr("是否完成") = True Then lbl.BackColor = color.green End If e.Form.AddControl(lbl) i = i+1 x = x + 100 lbl.ToolTip = dr("工序") & "内容" Next
|