以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]再次增加控件显示不对  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=77781)

--  作者:huhu
--  发布时间:2015/11/25 12:03:00
--  [求助]再次增加控件显示不对



--  作者:huhu
--  发布时间:2015/11/25 12:03:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

--  作者:huhu
--  发布时间:2015/11/25 12:04:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看

--  作者:huhu
--  发布时间:2015/11/25 12:05:00
--  
收货核实的click代码
Dim p As WinForm.TabPage = e.form.controls("TabControl1").tabpages(0)
Dim rkd As List(of String)
rkd = DataTables("预入库单").GetValues("入库单号","标志 = false")
Dim idx As Integer = 1
For Each rk As String In rkd
    Dim sum1 As String = Tables("预入库单").Compute("sum(数量)","入库单号 = \'" & rk & "\'")
    Dim btn As WinForm.button
    btn = e.Form.CreateControl("btn" & rk, ControlTypeEnum.Button)
    btn.Text = "预入库单号" & idx & ":" &  rk & "- - -(" & sum1 & ")台"
    btn.Left = 300
    btn.Top = idx * 100
    p.AddControl(btn)
    idx += 1
    btn.width = 400
    btn.height = 60
    btn.font = new font("方正粗圆简体", 15,fontstyle.bold)
    btn.FlatStyle = FlatStyle.flat
    btn.BackColor = Color.Aquamarine
    btn.BorderSize = 0
Next

--  作者:huhu
--  发布时间:2015/11/25 12:06:00
--  
扫描窗口的提交入库的click代码。
Dim fd1,fd2 As Integer
fd1 = yrkdh.text.IndexOf(":")
fd2 = yrkdh.text.IndexOf("-")
Dim str As String
str = yrkdh.text.SubString(fd1 + 1,fd2 -1 -fd1)
msgbox(str)
If str1 = str2 Then
    MessageBox.show("扫描统计的数量" & str1 & "和入库单预入库数量" & str2 & "一致","扫描入库结果",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Dim dr As DataRow =DataTables("预入库单").Find("入库单号 = \'" & str & "\'")
    If dr IsNot Nothing Then
        dr("标志") = True
    End If
Else
    MessageBox.show("扫描统计的数量" & str1 & "和入库单预入库数量不一致" & str2,"扫描入库结果",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Dim shhs As WinForm.Button = Forms("库存管理界面").Controls("收货核实")
Dim sum1 As Integer
sum1 = DataTables("预入库单").Compute("count(入库单号)","标志 = false")
shhs.text = "收货核实(" & sum1 & ")"
Dim p As WinForm.TabPage = Forms("库存管理界面").Controls("TabControl1").tabpages(0)
\'Dim p As WinForm.TabPage = e.form.controls("TabControl1").tabpages(0)
Dim rkd As List(of String)
rkd = DataTables("预入库单").GetValues("入库单号","标志 = false")
Dim idx As Integer = 1
For Each rk As String In rkd
    Dim sum2 As String = Tables("预入库单").Compute("sum(数量)","入库单号 = \'" & rk & "\'")
    Dim btn As WinForm.button
    btn = e.Form.CreateControl("btn" & rk, ControlTypeEnum.Button)
    btn.Text = "预入库单号" & idx & ":" &  rk & "- - -(" & sum2 & ")台"
    btn.Left = 300
    btn.Top = idx * 100
    p.AddControl(btn)
    idx += 1
    btn.width = 400
    btn.height = 60
    btn.font = new font("方正粗圆简体", 15,fontstyle.bold)
    btn.FlatStyle = FlatStyle.flat
    btn.BackColor = Color.Aquamarine
    btn.BorderSize = 0
Next

--  作者:大红袍
--  发布时间:2015/11/25 12:25:00
--  

先清空原来的button

 

Dim p As WinForm.TabPage = e.form.controls("TabControl1").tabpages(0)
For Each c As object In p.Children
p.RemoveControl(c.name)
Next