以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何统一设置窗口的状态栏  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=121449)

--  作者:ZJZK2018
--  发布时间:2018/7/6 13:30:00
--  如何统一设置窗口的状态栏
老师你好:
 如何统一设置项目所有窗口的状态栏,代码写在哪个事件中?

--  作者:有点甜
--  发布时间:2018/7/6 14:30:00
--  

具体一点你的问题,你要设置成怎样的?为什么要这样做?

 

动态添加菜单的话,参考 http://www.foxtable.com/webhelp/scr/Strips.htm

 


--  作者:ZJZK2018
--  发布时间:2018/7/6 14:41:00
--  
老师你好:
我现在每个窗口事件AfterLoad中都设置相同代码,有没有办法在打开项目中任何一个窗口时,自动增加到窗口的状态栏中,而不需要每个窗口去设置?
如:在打开项目中任何一个窗口时,先判断一下这个窗口有没有“e.Form.Strips("状态栏").Items("User")” 这个控件,如有则加载下面代码。
主要是写在哪个事件中比较合适?谢谢

Dim gs As DataRow = DataTables("系统设置").Find("小类 = \'公司名称\'")
Dim rj As DataRow = DataTables("系统设置").Find("小类 = \'软件名称\'")
Dim bbh As DataRow = DataTables("系统设置").Find("小类 = \'软件版本号\'")
e.Form.Strips("状态栏").Items("User").Text = " ★ ★ ★ " & User.Name & " ★ ★ ★ " & gs("值") & rj("值") & bbh("值") & "     " & Format(Date.Today,"yyyy年MM月dd日dddd" )

--  作者:有点甜
--  发布时间:2018/7/6 15:04:00
--  

写到定时器里面去,做一个定时器

 

http://www.foxtable.com/webhelp/scr/0657.htm

 

代码

 

For Each frm As winform.form In forms
    If frm.Opened Then
       
        If frm.strips.contains("状态栏") Then
            Dim gs As DataRow = DataTables("系统设置").Find("小类 = \'公司名称\'")
            Dim rj As DataRow = DataTables("系统设置").Find("小类 = \'软件名称\'")
            Dim bbh As DataRow = DataTables("系统设置").Find("小类 = \'软件版本号\'")
            frm.Strips("状态栏").Items("User").Text = " ★ ★ ★ " & User.Name & " ★ ★ ★ " & gs("值") & rj("值") & bbh("值") & "     " & Format(Date.Today,"yyyy年MM月dd日dddd" )
        End If
    End If
Next

 

[此贴子已经被作者于2018/7/6 15:07:53编辑过]

--  作者:有点甜
--  发布时间:2018/7/6 15:06:00
--  

或者,可以在每个窗口afterLoad事件写代码

 

functions.Execute("test", e)

 

做一个test函数,写代码

 

Dim e = args(0)

If frm.strips.contains("状态栏") Then
    Dim gs As DataRow = DataTables("系统设置").Find("小类 = \'公司名称\'")
    Dim rj As DataRow = DataTables("系统设置").Find("小类 = \'软件名称\'")
    Dim bbh As DataRow = DataTables("系统设置").Find("小类 = \'软件版本号\'")
    frm.Strips("状态栏").Items("User").Text = " ★ ★ ★ " & User.Name & " ★ ★ ★ " & gs("值") & rj("值") & bbh("值") & "     " & Format(Date.Today,"yyyy年MM月dd日dddd" )
End If