以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 自定义窗口如何利用状态栏计算 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=194149) |
-- 作者:lur320 -- 发布时间:2024/11/14 10:56:00 -- 自定义窗口如何利用状态栏计算 有自定义的独立窗口,也有主窗口的情况下。如何在systemidel实现下述计算,并显示在右下角? Dim t As Table = CurrentTable With t.Form If t.Form.Strips.Contains("screennotice") Then Dim it As Winform.StripItem = .Strips("状态栏").Items("screennotice") it.Text = "个数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " 累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) End If End With 将上述代码放到systemidel里面,遇到主窗口就会出错。因为主窗口的T.form会报错。如何实现? 而下面的代码是OK的。但是这个代码对于独立窗口下面Strips("状态栏").Items("screennotice")不起作用。 Dim t As Table = CurrentTable Dim str1 As String = "" With t RibbonMenu.StatusBar.Message3 = "" If .TopRow = .BottomRow AndAlso .LeftCol = .RightCol Then Return End If RibbonMenu.StatusBar.Message3 = "个数:" & .Aggregate(AggregateEnum.Count, .TopRow,.LeftCol,.BottomRow,.RightCol) & " 累计:" & .Aggregate(AggregateEnum.Sum,.TopRow,.LeftCol,.BottomRow,.RightCol) End With RibbonMenu.StatusBar.Refresh |
-- 作者:有点蓝 -- 发布时间:2024/11/14 11:00:00 -- Dim t As Table = CurrentTable if t.Form is nothing 按主窗口处理 else 按独立窗口处理 end if
|
-- 作者:lur320 -- 发布时间:2024/11/14 11:15:00 -- Dim t As Table = CurrentTable If t.Form Is Nothing Then Dim str1 As String = "" With t RibbonMenu.StatusBar.Message3 = "" If .TopRow = .BottomRow AndAlso .LeftCol = .RightCol Then Return End If RibbonMenu.StatusBar.Message3 = "个数:" & .Aggregate(AggregateEnum.Count,.TopRow, .LeftCol, .BottomRow, .RightCol) & " 累计:" & .Aggregate(AggregateEnum.Sum, .TopRow, .LeftCol, .BottomRow, .RightCol) End With RibbonMenu.StatusBar.Refresh Else With t.Form If .Strips("状态栏").Items.Contains("screennotice") Then Dim it As Winform.StripItem = .Strips("状态栏").Items("screennotice") it.Text = "个数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " 累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) End If End With End If 可以用
|