以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]dropdownform打开后的继续编辑问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=52675)

--  作者:jiskin
--  发布时间:2014/6/20 10:21:00
--  [求助]dropdownform打开后的继续编辑问题
table的 keypressedit 事件中
If e.Col.Name = "物料名称" Then
    If e.Col.DroppedDown = False Then
        e.Col.OpenDropDown()
    End If
End If

当dropdownform打开后,原本单元格中的编辑状态就没了,有没有办法保持?

--  作者:Bin
--  发布时间:2014/6/20 10:22:00
--  
http://www.foxtable.com/help/topics/2465.htm
--  作者:jiskin
--  发布时间:2014/6/20 10:25:00
--  
以下是引用Bin在2014-6-20 10:22:00的发言:
http://www.foxtable.com/help/topics/2465.htm

 

BIn大哥 我没有按照上面做的

changededit中我是这样的

If e.Col.Name = "物料名称" Then
    If e.Col.DroppedDown Then
        Dim t As Table = Tables("录入选择_Table1")
        If e.Text > "" Then
            t.Fill("select * from 物料库存_View_1 where 物料名称 like " & "\'%" & e.Text & "%\'","xxx",True)
            t.AutoSizeCols
            For Each cl As Col In t.Cols
                cl.TextAlign = TextAlignEnum.Center
            Next
            t.ListMode = True
            t.DataTable.SysStyles("CurrentRow").BackColor = Color.LawnGreen
        Else
            e.Col.CloseDropDown
        End If
    End If
End If


--  作者:jiskin
--  发布时间:2014/6/20 10:26:00
--  

在单元格输入第一个字符后 窗口打开了,并执行了筛选,但是单元格的编辑状态没有了 要重新用鼠标选中才行


--  作者:jiskin
--  发布时间:2014/6/20 10:32:00
--  

刚在dropdownform的 dropdownopened事件中加入这个

e.Form.DropDownBox.Select()

可以编辑了 但是

keydown 事件

If e.KeyCode = Keys.Enter Then
    With Tables("录入选择_Table1")
        If e.Form.DropTable IsNot Nothing Then
            If e.Form.DropTable.Name = "新增入库_Table1" Then
                Dim r As Row = Tables("新增入库_Table1").Current
                If r IsNot Nothing Then
                    e.Form.DropDownBox.Value = .Current("物料名称")
                    r("物料编号") = .Current("物料编号")
                End If
            End If

 

这个失效了,怎么回事

[此贴子已经被作者于2014-6-20 10:32:53编辑过]

--  作者:Bin
--  发布时间:2014/6/20 10:32:00
--  
呵呵,请仔细看帮助.


2、将窗口的DropDownOpened事件代码设置为:

Dim txt As String = e.Form.DropDownBox.Text
Dim
 tbl As Table = Tables("窗口1_Table1")
If
 txt = "" Then
    
tbl.Filter = ""
Else

    txt = 
"\'%" & txt & "%\'"
    tbl.Filter = 
"客户ID Like " & txt & " Or 公司名称 Like " & txt & " Or 地址 Like " & txt & " Or 联系人 Like " & txt
End
 If
e.Form.DropDownBox.
Select() 
\'将输入焦点返回下拉列表框


--  作者:jiskin
--  发布时间:2014/6/20 10:35:00
--  
以下是引用Bin在2014-6-20 10:32:00的发言:
呵呵,请仔细看帮助.


2、将窗口的DropDownOpened事件代码设置为:

Dim txt As String = e.Form.DropDownBox.Text
Dim
 tbl As Table = Tables("窗口1_Table1")
If
 txt = "" Then
    
tbl.Filter = ""
Else

    txt = 
"\'%" & txt & "%\'"
    tbl.Filter = 
"客户ID Like " & txt & " Or 公司名称 Like " & txt & " Or 地址 Like " & txt & " Or 联系人 Like " & txt
End
 If
e.Form.DropDownBox.
Select() 
\'将输入焦点返回下拉列表框

 

这个感觉和table中的 changedit 事件重复了……所以我没写,光写了个

e.Form.DropDownBox.Select() \'将输入焦点返回下拉列表框

 

难道一定要添加进去?


--  作者:Bin
--  发布时间:2014/6/20 10:37:00
--  
请严格按照帮助来做哦