Foxtable(狐表)用户栏目专家坐堂 → 系统自带菜单移植到窗口菜单


  共有2029人关注过本帖树形打印复制链接

主题:系统自带菜单移植到窗口菜单

帅哥哟,离线,有人找我吗?
nuoyan88
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
系统自带菜单移植到窗口菜单  发帖心情 Post By:2018/1/1 0:10:00 [只看该作者]

用户已被锁定

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/1 19:46:00 [只看该作者]

1、你要在你的菜单加入

 

Less、LessOrEqual、More ......等等名称的菜单,然后才能写代码。

 

2、代码必须修改。你先把菜单设计出来先吧。然后发上来。


 回到顶部
帅哥哟,离线,有人找我吗?
nuoyan88
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/1 20:25:00 [只看该作者]

用户已被锁定

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/1 22:20:00 [只看该作者]

ItemMouseEnter事件写代码,如下

 

你还必须在【itemClick】事件实现各个菜单的筛选功能,具体看系统菜单的代码。

 

If e.StripItem.name = "筛选" Then
    Dim t As Table = CurrentTable
    Dim c As Col = t.Cols(t.ColSel)
    Dim m = e.Form.strips("工具栏1").Items("筛选")
    Dim Less As WinForm.StripItem = m.Items("Less")
    Dim LessOrEqual As WinForm.StripItem = m.Items("LessOrEqual")
    Dim More As WinForm.StripItem = m.Items("More")
    Dim MoreOrEqual As WinForm.StripItem = m.Items("MoreOrEqual")
    Dim Equal As WinForm.StripItem = m.Items("Equal")
    Dim NotEqual As WinForm.StripItem = m.Items("NotEqual")
    Dim SamePeriod  = m.Items("SamePeriod")
    Dim Period = m.Items("Period")
    'Dim Separator = m.Items("Separator")
    Dim StringFilter = m.Items("StringFilter")
    Dim ValueFilter = m.Items("ValueFilter")
    Dim FilterTrue = m.Items("FilterTrue")
    Dim FilterFalse = m.Items("FilterFalse")
    Dim Null As WinForm.StripItem = m.Items("Null")
    Dim NotNull  = m.Items("NotNull")
   
    If c.IsDate Then
        ValueFilter.Text= "日期筛选"
    ElseIf c.IsNumeric Then
        ValueFilter.Text= "数值筛选"
    End If
    If t.Position < 0 Then
        FilterTrue.Visible = False
        FilterFalse.Visible = False
        Less.Visible = False
        LessOrEqual.Visible = False
        More.Visible = False
        MoreOrEqual.Visible = False
        Equal.Visible = False
        NotEqual.Visible = False
        SamePeriod.Visible = False
        'Separator.Visible = False
        Period.Visible = c.IsDate
        Return
    Else
        Period.Visible = c.IsDate
        SamePeriod.Visible = c.IsDate
        'Separator.Visible = c.IsDate Or c.IsString Or c.IsNumeric
        StringFilter.Visible = c.IsString
        ValueFilter.Visible = c.IsDate Or c.IsNumeric
        If c.IsDate Then
            SamePeriod.Items("Hour").Visible = (c.DataCol.DateTimeFormat <> DateTimeFormatEnum.Date)
            SamePeriod.Items("Minute").Visible = (c.DataCol.DateTimeFormat <> DateTimeFormatEnum.Date)
        End If
    End If
    If c.IsBoolean Then
        FilterTrue.Visible = True
        FilterFalse.Visible = True
        Equal.Visible = False
        NotEqual.Visible = False
        Less.Visible = False
        More.Visible = False
        LessOrEqual.Visible = False
        MoreOrEqual.Visible = False
        Null.Visible = False
        NotNull.Visible = False
    Else
        FilterTrue.Visible = False
        FilterFalse.Visible = False
        Equal.Visible = True
        NotEqual.Visible = True
        Null.Visible = True
        NotNull.Visible = True
        If t.Current.IsNull(t.ColSel) OrElse c.IsString Then
            Less.Visible = False
            More.Visible = False
            LessOrEqual.Visible = False
            MoreOrEqual.Visible = False
        Else
            Less.Visible = True
            More.Visible = True
            LessOrEqual.Visible = True
            MoreOrEqual.Visible = True
        End If
    End If
    If t.Current.IsNull(t.ColSel) Then
        Equal.Visible = False
        NotEqual.Visible = False
        m.Items("SamePeriod").Visible = False
    ElseIf c.IsString Then
        Dim v As String = t.Text
        If v > "" AndAlso v.Length > 15 Then
            v = v.SubString(0,15) & "..."
        End If
        Equal.Text = "等于 """ & v  & """"
        NotEqual.Text = "不等于 """ & v & """"
    ElseIf c.IsNumeric Then
        Equal.Text = "等于 " & t.Text
        NotEqual.Text = "不等于 " & t.Text
        Less.Text = "小于 " & t.Text
        LessOrEqual.Text = "不大于 " & t.Text
        More.Text = "大于 " & t.Text
        MoreOrEqual.Text = "不小于 " & t.Text
    ElseIf c.IsDate Then
        Equal.Text = "等于 " & t.Text
        NotEqual.Text = "不等于 " & t.Text
        Less.Text = "早于 " & t.Text
        More.Text = "晚于 " & t.Text
        LessOrEqual.Text = "不晚于 " & t.Text
        MoreOrEqual.Text = "不早于 " & t.Text
    End If
End If

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
nuoyan88
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/1 23:02:00 [只看该作者]

用户已被锁定

 回到顶部