-- 作者:ajie5211
-- 发布时间:2017/5/3 8:10:00
--
以下是引用有点色在2017/5/2 17:44:00的发言:
先触发的的是click事件,如果你click事件写的代码是弹出一个提示,或者模式窗口,你自然不会再触发doubleclick事件。
click没有弹出,代码如下
If e.Row("品名料号") <> "" Then Dim dt As Date = Date.Now.AddMonths(-3) DataTables("产品出入库信息").LoadFilter = "产品料号 = \'"& e.Row("品名料号") &"\' And 日期 >= \'" & dt & "\'" DataTables("产品出入库信息").Load Dim g As New CrossTableBuilder("出入库统计", DataTables("产品出入库信息")) g.HGroups.AddDef("仓库名称") g.HGroups.AddDef("日期", DateGroupEnum.None) g.HGroups.AddDef("库存结余") g.HGroups.AddDef("单号") g.VGroups.AddDef("出入库类型") g.VGroups.AddDef("类型") g.Totals.AddDef("数量", "数(重)量") g.VerticalTotal = True DataTables("产品月季总出货量").LoadFilter = "产品料号 = \'" & e.Row("品名料号") & "\' and 仓库名称 = \'" & e.Row("仓库名称") & "\' And 年 >= " & Date.Today.Year - 2 DataTables("产品月季总出货量").Load Tables("产品月季总出货量").Sort = "年,月(季)" If Forms("单独库存查询").Opened Then Tables("单独库存查询_Table2").DataSource = g.BuildDataSource() Dim ct1 As WinForm.Chart = Forms("单独库存查询").Controls("Chart1") Dim ct2 As WinForm.Chart = Forms("单独库存查询").Controls("Chart2") Dim Sr1 As WinForm.ChartSeries Dim Sr2 As WinForm.ChartSeries Dim tbl As DataTable = DataTables("产品月季总出货量") Dim lsty As new List(Of String) Dim lstyn As new List (of Integer) Dim lstyy As new List (of Integer) Dim lstj As new List(of String) Dim lstjn As new List (of Integer) Dim lstjy As new List (of Integer) Dim yj As String Dim i As Integer For i = 0 To Tables("产品月季总出货量").Rows.Count - 1 Dim n As String = CStr(Tables("产品月季总出货量").Rows(i)("年")) Dim y As String = CStr(Tables("产品月季总出货量").Rows(i)("月(季)")) yj = n & y If Tables("产品月季总出货量").Rows(i)("月季份") = "月" Then lsty.Add(yj) lstyn.Add(Tables("产品月季总出货量").Rows(i)("年")) lstyy.add(Tables("产品月季总出货量").Rows(i)("月(季)")) Else lstj.Add(yj) lstjn.add(Tables("产品月季总出货量").Rows(i)("年")) lstjy.add(Tables("产品月季总出货量").Rows(i)("月(季)")) End If yj = "" Next ct1.ChartType = ChartTypeEnum.Bar ct1.SeriesList.Clear() \'清除图表原来的图系 Ct1.AxisY.ClearValueLabel Ct1.AxisX.ClearValueLabel Sr1 = ct1.SeriesList.Add() \'增加一个图系 Sr1.Length = lsty.Count \'设置图系的长度 For h As Integer = 0 To lsty.Count - 1 \'指定每个数据点的位置 Sr1.X(h) = h \'指定水平坐标 sr1.Y(h) = tbl.Compute("Sum(总出货量)","[月季份] = \'月\' and [年] = " & lstyn(h) & " and [月(季)] = " & lstyy(h))\'指定垂直坐标 Ct1.AxisX.SetValueLabel(h, lsty(h)) \'指定字符表示 Next Ct1.AxisX.AnnoWithLabels = True \'启用字符标示 sr1.DataLabelText = "{#YVAL}" \'Ct1.AxisX.AnnoRotation = -45 ct2.ChartType = ChartTypeEnum.Bar ct2.SeriesList.Clear() \'清除图表原来的图系 Ct2.AxisY.ClearValueLabel ct2.AxisX.ClearValueLabel Sr2 = ct2.SeriesList.Add() \'增加一个图系 Sr2.Length = lstj.Count \'设置图系的长度 For j As Integer = 0 To lstj.Count - 1 \'指定每个数据点的位置 Sr2.X(j) = j \'指定水平坐标 sr2.Y(j) = tbl.Compute("Sum(总出货量)","[月季份] = \'季\' and [年] = " & lstjn(j) & " and [月(季)] = " & lstjy(j))\'指定垂直坐标 Ct2.AxisX.SetValueLabel(j, lstj(j)) \'指定字符表示 Next Ct2.AxisX.AnnoWithLabels = True \'启用字符标示 sr2.DataLabelText = "{#YVAL}" \'Ct2.AxisX.AnnoRotation = -45 Dim gb2 As WinForm.GroupBox = Forms("单独库存查询").Controls("GroupBox2") gb2.Text = e.Row("品名料号") & "产品近三个月出入库详情" Dim gb3 As WinForm.GroupBox = Forms("单独库存查询").Controls("GroupBox3") gb3.Text = e.Row("品名料号") & "近两年季用量走势图" Dim gb4 As WinForm.GroupBox = Forms("单独库存查询").Controls("GroupBox4") gb4.Text = e.Row("品名料号") & "近两年月用量走势图" End If End If
|