Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:自定义窗口如何利用状态栏计算

1楼
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


2楼
有点蓝 发表于:2024/11/14 11:00:00
Dim t As Table = CurrentTable
if t.Form is nothing 
按主窗口处理
else
按独立窗口处理
end if
3楼
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

可以用
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.