在状态栏显示动态信息

如果你需要针对不同的表、不同的列、甚至不同状态的行,在状态栏显示动态信息,可以用全局表事件AfterSelChange。

可以参考下面的代码:

Select Case e.Table.Name
    Case
"表名一"
        StatusBar.Message1 =
"信息一"
   
Case "表名二"
        StatusBar.Message1 =
"信息二"
   
Case "表名三"
       
Dim ColName As String
        ColName = e.
Table.Cols(e.Table.ColSel).Name
        Select
Case
ColName
            Case
"列名1"
                StatusBar.Message1 =
"信息1"
           
Case "列名2"
                StatusBar.Message1 =
"信息2"
           
Case Else
                StatusBar.Message1 =
"就绪"
       
End Select
   
Case "表名四"
       
Dim Val As String = e.Table.Current("某列名")
        Select
Case
Val
            Case
"值1"
                StatusBar.Message1 =
"信息1"
           
Case "值2"
                StatusBar.Message1 =
"信息2"
           
Case Else
                StatusBar.Message1 =
"就绪"
       
End Select
   
Case Else
        StatusBar.Message1 =
"就绪"
End
Select

如果你只是想针对不同的表、不同的行显示不同的提示信息,那么应该设置在全局表事件CurrentChanged中:

Select Case e.Table.Name
    Case
"表名一"
        StatusBar.Message1 =
"信息一"
   
Case "表名二"
        StatusBar.Message1 =
"信息二"
    Case "表名三"
       
Dim Val As String = e.Table.Current("某列名")
        Select
Case
Val
            Case
"值1"
                StatusBar.Message1 =
"信息1"
           
Case "值2"
                StatusBar.Message1 =
"信息2"
           
Case Else
                StatusBar.Message1 =
"就绪"
       
End Select
   
Case Else
        StatusBar.Message1 =
"就绪"
End
Select

全局表事件AfterSelChange和CurrentChanged默认是对所有表开启的,不需要另外编写开启代码。

如果你只是想针对不同的表显示不同的信息,可以设置在项目事件CurrentTableChanged中:

Select Case CurrentTable.Name
    Case
"表名一"
        StatusBar.Message1 =
"信息一"
   
Case "表名二"
        StatusBar.Message1 =
"信息二"
    Case "表名三"
     
  StatusBar.Message1 = "信息三"
    Case Else
        StatusBar.Message1 =
"就绪"
End
Select

如果你只是想针对不同的主表显示不同的信息,可以设置在项目事件MainTableChanged中:

Select Case MainTable.Name
    Case
"表名一"
        StatusBar.Message1 =
"信息一"
   
Case "表名二"
        StatusBar.Message1 =
"信息二"
    Case "表名三"
     
  StatusBar.Message1 = "信息三"
    Case Else
        StatusBar.Message1 =
"就绪"
End
Select


本页地址:http://www.foxtable.com/webhelp/topics/1474.htm