-- 作者:cd_tdh
-- 发布时间:2020/3/31 15:07:00
-- 流程图
老师,我流程图换了个思路,用按钮加图片来控制,中间横线的按钮写了置顶,没起作用,请老师看看?
\'生成流程图 Dim frm As WinForm.Form = Forms("审核进度") Dim i As Integer = 0 Dim ajm As List(of DataRow) = DataTables("审核流程表").Select("表名称=\'测试表\'","流程编号") For Each aj2 As DataRow In ajm Dim aj As String = aj2("审核人角色") Dim abc As WinForm.Button abc = frm.CreateControl(aj,ControlTypeEnum.Button) abc.Text = aj abc.Height = 60 \'控件高度 abc.Width = 100 \'控件宽度 abc.left = i*120+30 abc.Top = 35 abc.Image = GetImage("进度1.png") \'图标 \'按钮样式 abc.FlatStyle = FlatStyle.flat \'按钮样式 abc.BackColor = Color.Transparent \'背景颜色 abc.MouseDownBackColor = Color.Transparent \'设置鼠标经过时,按钮的背景颜色 abc.MouseDownBackColor = Color.Transparent \'设置鼠标经过时,按钮的背景颜色 abc.BorderColor = Color. White \'设置按钮边框颜色 abc.BorderSize = 0 \'设置按钮边框厚度,单位为像素 \'图标,文本位置 abc.ImageAlign= ContentAlignment.TopCenter \'图标位置,居中 abc.TextAlign = ContentAlignment.BottomCenter \'名称位置,靠左居中 frm.AddControl(abc) Dim aba As WinForm.Button aba = frm.CreateControl(aj,ControlTypeEnum.Button) aba.Height = 20 \'控件高度 aba.Width = 80 \'控件宽度 aba.Image = GetImage("横线1.png") \'图标 aba.left = i*120+100 aba.Top = 45 \'按钮样式 aba.FlatStyle = FlatStyle.flat \'按钮样式 aba.BackColor = Color.Transparent \'背景颜色 aba.MouseDownBackColor = Color.Transparent \'设置鼠标经过时,按钮的背景颜色 aba.MouseDownBackColor = Color.Transparent \'设置鼠标经过时,按钮的背景颜色 aba.BorderColor = Color. White \'设置按钮边框颜色 aba.BorderSize = 0 \'设置按钮边框厚度,单位为像素 \'图标,文本位置 aba.ImageAlign= ContentAlignment.MiddleCenter \'图标位置,居中 \'aba.TextAlign = ContentAlignment.BottomCenter \'名称位置,靠左居中 frm.AddControl(aba) i+=1 aba.basecontrol.BringToFront \'置前 \'aba.basecontrol.SendToBack \'置后 Next
|
-- 作者:2900819580
-- 发布时间:2020/3/31 21:03:00
--
如果你表中有签核结果这列的话,可以根据aj2("签核状态")来识别应该用进度2.png还是进度1.png,
我的流程图是根据序号来识别的。
Dim But As WinForm.Button Dim tb As Table = Tables(e.Form.Name & "_Table1")
For Each f As WinForm.Control In e.Form.Controls("g3").Children e.Form.Controls("G3").RemoveControl(f.Name) Next Dim i As Integer = 30 For Each r As Row In tb.Rows But = e.Form.CreateControl("But流程" & r("权限"), ControlTypeEnum.Button) But.Text = r("权限") & vbcrlf & r("需签人") If r("签核状态") = "Y" Then but.Enabled = False But.Left = 5 but.Width = 75 but.Height = 45 But.Top = i e.Form.Controls("G3").AddControl(But) i += 90 Next i = 75 For ii As Integer = 0 To tb.Rows.Count - 2 Dim jpg As WinForm.PictureBox jpg = e.Form.CreateControl("Pb" & ii,ControlTypeEnum.PictureBox) If tb.Rows(ii)("签核状态") = "Y" Then jpg.ImageFile = "\\向下14.png" Else jpg.ImageFile = "\\向下15.png" End If jpg.SizeMode = ImageSizeMode.Zoom jpg.Left = 20 jpg.Top = i jpg.Width = 45 jpg.Height = 45 jpg.BackColor = Color.WhiteSmoke e.Form.Controls("G3").AddControl(Jpg) i += 90 Next e.Form.Controls("G3").Visible = True
[此贴子已经被作者于2020/3/31 21:07:29编辑过]
|